asp.net
Using System.web.Mail;
MailMessage msg = new MailMessage ();
The sender's address, such astest@163.com)
Msg. from = "zdyguilong@163.com";
The address of the receiving party, such astest@163.com)
Msg. to = "zdyguilong@163.com";
Body Content Type
Msg. BodyFormat = mailformat.html;
Body content Encoding
Msg. bodyencoding = System.Text.Encoding.Default;
Theme
Msg. Subject = "Zhangdayu hello to You";
Content
Msg. BODY = "Set to require user authentication
Msg. Fields.Add ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"," 1 ");
Set Authentication User Name
Msg. Fields.Add ("Http://schemas.microsoft.com/cdo/configuration/sendusername"," Zdyguilong ");
Set Authentication password
Msg. Fields.Add ("Http://schemas.microsoft.com/cdo/configuration/sendpassword"," 123456 ");
Mail server address (such as smtp.163.com)
Smtpmail.smtpserver = "smtp.163.com";
Send
Smtpmail.send (msg);
Response.Write (' <script language= ' JavaScript ' >alert (' registered success '); Window.location= '. /default.aspx ' </script> ');