Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Mail in vb.net windows application
Author:
Sumit Patel
E-mail:
Click to e-mail author
Website:
http://sites.google.com/site/sumitpatelgft
Submitted:
5/21/2012
Version:
VB 2008
Compatibility:
VB 2008, VB 2010
Category:
Forms
Views:
9629
This is code shows how to send mail in vb.net. Please see the code and apply.
Declarations:
'none
Code:
Imports System.Net.Mail after Dim mail As New MailMessage() after 'Dim SmtpServer As New SmtpClient() 'SmtpServer.Credentials = New Net.NetworkCredential("gmail id", "password") 'SmtpServer.Port = 587 'SmtpServer.Host = "smtp.gmail.com" 'SmtpServer.EnableSsl = True 'mail = New MailMessage() 'Dim addr() As String = "(send mail id)".Split(",") 'Try ' mail.From = New MailAddress(mail id", "test...", System.Text.Encoding.UTF8) ' Dim i As Byte ' For i = 0 To addr.Length - 1 ' mail.To.Add(addr(i)) ' Next ' mail.Subject = "test..." ' mail.Body = "id:- " test ' SmtpServer.Send(mail) 'Catch ex As Exception ' MsgBox(ex.ToString()) 'End Try '.
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement