Friday, July 10, 2009

Open outlook and add reciepient emailid

To send mail call the below method in .Net.
1)
using System.Web.Mail;
public Boolean SendMail(string pstrFrom, string pstrTo, string pstrSubject, string pstrBody)
{
Boolean Result = false;
try
{
MailMessage omsg = new MailMessage();
omsg.From = pstrFrom;
omsg.To = pstrTo;
omsg.Subject = pstrSubject;
omsg.Body = pstrBody;
omsg.Priority = MailPriority.High;
omsg.BodyFormat = MailFormat.Html;
SmtpMail.SmtpServer = "";
SmtpMail.Send(omsg);
Result = true;
}
catch (Exception ex)
{
Result = false;
AppLogger.LogError("SendMail(4 parameters): " + ex.Message, AppLogger.Severity.Error);

}
return Result;

}

2)To open a outlook.

Copyright © 2009 Angel