The email account and password used below are not authentic. If you need to test the password, replace it with your own email account. Need to reference: using system. net. mail; using system. text; using system. net; program code: mailmessage mymail = new mailmessage (); // create the mail Instance Object mymail. from = new mailaddress (""); // sender, which corresponds to the verification information of the email server and cannot be changed at will. to. add (New mailaddress (""); // recipient mymail. subject = "C # Send email"; // mail subject mymail. subjectencoding = encoding. utf8; // The title code is mymail. body = "this is a test email! "; // Mail content mymail. bodyencoding = encoding. utf8; // The email Content Encoding mymail. isbodyhtml = true; // whether the mail content supports HTML smtpclient SMTP = new smtpclient (); // create an SMTP Instance Object SMTP. host = "mail.sina.com"; // SMTP on the mail server. port = 25; // the mail server port SMTP. credentials = new networkcredential ("", "123456"); // SMTP. send (mymail); // mail example mailmessage mymail = new mailmessage (); mymail. from = new mailaddress (""); Myma Il. to. add (New mailaddress (""); mymail. subject = "C # Send email"; mymail. subjectencoding = encoding. utf8; mymail. body = "this is a test email from Gmail! <A href = 'HTTP: // www.sina.com.cn '> Sina </a> "; mymail. bodyencoding = encoding. utf8; mymail. isbodyhtml = true; smtpclient SMTP = new smtpclient (); SMTP. host = "smtp.gmail.com"; SMTP. port = 587; // SMTP port of Gmail SMTP. credentials = new networkcredential ("", "123456"); SMTP. enablessl = true; // Gmail requires SSL to connect to SMTP. deliverymethod = smtpdeliverymethod. network; // The Gmail sending method is through the network. You must specify SMTP. send (mymail); use QQ mail to send Mail example mailmessage mymail = new mailmessage (); mymail. from = new mailaddress (""); mymail. to. add (New mailaddress (""); mymail. subject = "C # Send email"; mymail. subjectencoding = encoding. utf8; mymail. body = "this is a test email from QQ! "; Mymail. bodyencoding = encoding. utf8; mymail. isbodyhtml = true; smtpclient SMTP = new smtpclient (); SMTP. host = "smtp.qq.com"; SMTP. credentials = new networkcredential ("", "123456"); SMTP. send (mymail );