Using System.net.mail;
to 要发送到的地址
from你的信箱地址
subject 信件主题
body信件内容
userName信箱用户名
password信箱密码
smtpHost smtp
public void Send(string to, string from, string subject, string body, string userName, string password, string smtpHost)
{
MailAddress From = new MailAddress(from);
MailAddress To = new MailAddress(to);
MailMessage message = new MailMessage(From, To);
message.Subject = subject;
message.IsBodyHtml = true;
message.Body = body;
SmtpClient client = new SmtpClient(smtpHost);
client.Credentials = new NetworkCredential(userName, password);
client.Send(message);
}
---------------------------------------------
就是一个方法
放在你的代码页面内就可以了.