地址如下:
http://www.codeproject.com/KB/aspnet/aspnetemailusinggmail.aspx
public static void sendMail(string to, string from, string subject,
string body,string username, string password)
{
///Smtp config
SmtpClient client = new SmtpClient("smtp.gmail.com", 465);
// Edit password and username
client.Credentials = new NetworkCredential(""+username+"@gmail.com", password);
client.EnableSsl = true;
Mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] =
""+username+"@gmail.com";
Mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = password;
client.Credentials = new NetworkCredential("USERNAME@gmil.com", "PASSWORD");
Mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] =
"USERNAME@gmail.com";
Mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = "PASSWORD";
作者来自 斯里兰卡(南亚岛国)。