Sunday, January 23, 2011

Sending E-mail in C#

Namespace System.Net.Mail  is used for this purpose where you will  find 4 classes to be used for sending mails.These are
1 MailMessage
2 MailSubject
3 Attachment
4 SmtpClient

protected void Page_Load(object sender,Event args)
MailMessage myMessage=new  MailMessage ();
myMessage.Subject="Text Message";
myMessage.Body="Hello world";
myMessage.From=new myMessage("","sender's name");
myMessage.To.Add("","reciever's name");
SmtpClient mySmtpClient=new SmtpClient();

No comments:

Post a Comment