简单的发送邮件方法
private void MailSend()
{
System.Net.Mail.SmtpClient MySmtp = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
//設定你的帳號密碼
MySmtp.Credentials = new System.Net.NetworkCredential("YourId", "YourPwd");
//Gmial 的 smtp 使用 SSL
MySmtp.EnableSsl = true;
//發送Email
MySmtp.Send("发件人地址", "收件人地址", "主题", "内容");
}
{
System.Net.Mail.SmtpClient MySmtp = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
//設定你的帳號密碼
MySmtp.Credentials = new System.Net.NetworkCredential("YourId", "YourPwd");
//Gmial 的 smtp 使用 SSL
MySmtp.EnableSsl = true;
//發送Email
MySmtp.Send("发件人地址", "收件人地址", "主题", "内容");
}