Using System. collections. generic; using System. text; using System. net; using System. net. mail; try {// The Encoding must be GB2312 encoding Encoding = Encoding. getEncoding (936); MailMessage Message = new MailMessage (new MailAddress ("your mailbox", "5", encoding), // The first is the sender's address, the second parameter is the sender's new MailAddress (TextBox1.Text); // recipient's email Message. subjectEncoding = encoding; Message. subject = TextBox2.Text; // The title Message. bodyEncoding = encoding; Message. body = TextBox3.Text; // subject SmtpClient smtpClient = new SmtpClient ("smtp.163.com"); // Mail Server smtpClient. credentials = new NetworkCredential ("your mailbox username", "Your mailbox password"); // the username and password of the mailbox smtpClient. timeout = 999999; smtpClient. send (Message);} catch (Exception ex) {throw new Exception (ex. message );}