Sending E-mails From ASP.Net

Step 1: Place the following in your web.config file, making sure to replace the username and password fields with a valid inbox created from within the control panel:




        <smtp from="">

          <network host="" port="25" password="password" userName="" defaultCredentials="false" />






Step 2: From within the page, use the code below replacing the from, to, subject, and body fields:
Dim mm As New MailMessage()

mm.From = New MailAddress("", "John Doe")

mm.To.Add(New MailAddress(""))

mm.To.Add(New MailAddress(""))

mm.Subject = "Subject line"

mm.Body = "This is the can include html tags for formatting"

mm.IsBodyHtml = True

Dim smtp As New SmtpClient


Add Feedback