Send E with .NET

xiaoxiao2021-03-06  77

Using system.web.util;

Using system.web.mail;

Using system.net;

Private void button2_click (Object Sender, System.Eventargs E)

{

Try

{

MailMessage Message = New MailMessage ();

Message.to = "

Laihua0316@163.com ";

Message.from = "

Laihua80316@163.com ";

Message.subject = "Today is very good !!";

Message.Body = "I wish you all a happy work !!";

Message.fields.add ("

Http://schemas.microsoft.com/cdpo/configuration/smtpauthenticate "," 1 ");

Message.fields.add ("

http://schemas.microsoft.com/cdpo/configuration/sendusername "," laihua80316 "); //

Message.fields.add ("

http://schemas.microsoft.com/cdpo/configuration/sendpassword "," ****** "); //

SMTPMAIL.SMTPSERVER = "SMTP.163.com";

SMTPMAIL.SEND (Message);

Response.write ("