Monday, November 10, 2008

Code to send the e-mail from .NET Code

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Mail;

namespace Mail
{
public class SendMail
{
public void Mail(string strFrom,string strTo,string strBody,string strSubject)
{
MailMessage objMailmsg = new MailMessage();
objMailmsg.To = strTo;
objMailmsg.From = strFrom;
objMailmsg.BodyFormat = MailFormat.Html;
objMailmsg.Subject = strSubject;
objMailmsg.Body = strBody;
SmtpMail.SmtpServer = "";
SmtpMail.Send(objMailmsg);
}
}
}

No comments: