Simple ASP.NET Email function

Sending an email from within ASP.NET is easy as long as you have access to an SMTP server to deliver it.

<%@ Import Namespace="System.Web.Mail"%>

<%
Dim objMail As New System.Web.Mail.MailMessage()

    objMail.From = "recipient_address1@domain.com"
    objMail.To = "recipient_address2@domain.com"
    objMail.Subject = "The Subject Line"
    objMail.BodyFormat = MailFormat.Html 'MailFormat.Text to send plain text email
    objMail.Priority = MailPriority.High
    objMail.Body =   "********************<BR>" & _
"Thank you for visiting my website" & _
"********************<BR>" 
    
    System.Web.Mail.SmtpMail.SmtpServer = "mail.yoursmtpserver.com"
    System.Web.Mail.SmtpMail.Send(objMail)
    objMail = Nothing

%>


asp.net .net email .net function DOT NET Email


Back To Top
© 1998 - 2024 psacake.com
Version 7.21 | Advertise on this site