string to = "这里填写接收者的Email地址"; string from = "这里填写发送者的Email地址"; string subject = "这里写邮件的主题"; string body = @"这里写邮件的内容";
MailMessage message = new MailMessage(from, to, subject, body); //SmtpClient client = new SmtpClient("smtp.gmail.com", 465); SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.Credentials = new NetworkCredential("Gmail帐户", "Gmail密码"); client.EnableSsl = true;