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:
<configuration>
<!-- Add the email settings to the <system. net> element -->
<system.net>
<mailsettings>
<smtp>
<network host="relayServerHostname" port="portNumber" userName="username" password="password" />
<system.net>
</configuration>
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("Fromanyone@somedomain.com", "John Doe")
mm.To.Add(New MailAddress("FirstRecipient@recipientdomain.com"))
mm.To.Add(New MailAddress("SecondRecipient@seconddomain.com"))
mm.Subject = "Subject line"
mm.Body = "This is the message...it can include html tags for formatting"
mm.IsBodyHtml = True
Dim smtp As New SmtpClient
smtp.Send(mm)