asp.net技术内幕的书配源码
源代码在线查看: sendhtml.aspx
void Page_Load(Object sender , EventArgs e)
{
MailMessage objMailMessage;
string strHTMLBody;
// Create the HTML Message Body
strHTMLBody = "" + "Thank You!" + "" + "" + "Thank you for registering!" + "";
// Create the Mail Message
objMailMessage = new MailMessage();
objMailMessage.From = "you@somewhere.com";
objMailMessage.To = "joe@somewhere.com";
objMailMessage.Subject = "Thanks for Registering!";
objMailMessage.Body = strHTMLBody;
objMailMessage.BodyFormat = MailFormat.Html;
// Send the Mail Message
SmtpMail.Send( objMailMessage );
Response.Write("HTML Email Sent!");
}