Knowledgebase: Email
Sending email via ASP.NET 2.0
Posted by Bill Williams, Last modified by Bill Williams on 02 August 2007 11:19 AM

If you are moving to ASP.NET 2.0, you should know that the method of sending emails has changed slightly.

The following code has been tested on our server.

Dim MailObj As New System.Net.Mail.SmtpClient
MailObj.Host = "127.0.0.1" 'localhost could be used or mail.domain.name
Dim cred As New Net.NetworkCredential("authemail", "authpass")
MailObj.Credentials = cred
MailObj.Send("fromemail", "destemail", "subject", "body here")

(617 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).