Abundant Technologies - IT Consulting Experts

 Source Code Library

 Code Details

 
'/ '/ Send an e-mail message '/ '/ message to be sent '/ subject of the e-mail '/ receiver's e-mail '/ sender's e-mail Public Sub EmailMessage(ByVal sMessage As String, ByVal sSubject As String, ByVal sTo As String, ByVal sFrom As String) Try 'Create an instance of the MailMessage class Dim MyMessage As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage 'Set the properties MyMessage.To = sTo MyMessage.From = sFrom 'Send the email in text format MyMessage.BodyFormat = System.Web.Mail.MailFormat.Text 'Set the priority - options are High, Low, and Normal MyMessage.Priority = System.Web.Mail.MailPriority.High 'Set the subject MyMessage.Subject = sSubject 'Set the body MyMessage.Body = sMessage 'Now, to send the message, use the static Send method of the SmtpMail class System.Web.Mail.SmtpMail.SmtpServer = "mail.myServer.com" System.Web.Mail.SmtpMail.Send(MyMessage) Catch End Try End Sub '/ '/ Send an e-mail message (sender is from webmaster@3pc.com) '/ '/ message to be sent '/ subject of the e-mail '/ receiver's e-mail Public Sub EmailMessage(ByVal sMessage As String, ByVal sSubject As String, ByVal sTo As String) EmailMessage(sMessage, sSubject, sTo, "yourname@myServer.com") End Sub

Mail To: info@3pc.com