Your Ad Here
Welcome To Mega Star Party,Megafans,Chiru&Pawanfans, Ram Charanfans Site
Featured Blogs: Related To Naidu Community

Monday, December 15, 2008

send message using the smtp server

Using C#using System.Web.Mail;public static void SendSecureEmail(string send_emailid){try{MailMessage mail = new MailMessage();mail.To = send_emailid;mail.From = "from email id";mail.Subject = "Test Email";mail.BodyFormat = MailFormat.Text;mail.Body = "Hello Guest Welcome on Qualispace Mail server";mail.Priority = MailPriority.High;SmtpMail.SmtpServer = "mail server name";mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "sales@eresourceinfotech.com");mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "sales123");SmtpMail.Send(mail);}catch (Exception ex){throw new Exception("Message : " + ex.Message + "Source: " + ex.Source);}}


Using using VB
Imports System.Web.Mail

Dim mail As New MailMessagemail.[To] = send_emailidmail.From = "sales@eresourceinfotech.com"mail.Subject = "Test Email"mail.BodyFormat = MailFormat.Textmail.Body = "Hello Guest Welcome on Qualispace Mail server"mail.Priority = MailPriority.HighSmtpMail.SmtpServer = "mail.eresourceinfotech.com"mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "sales@eresourceinfotech.com")mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "sales123")SmtpMail.Send(mail)

No comments:

Post a Comment