System.Web.Mail

http://www.systemwebmail.com/faq/4.1.aspx


------------
Dim NewMail As SmtpMail
Dim message As New MailMessage
Dim mailID As String = ConfigurationSettings.AppSettings("MailID")
Dim mailPwd As String = ConfigurationSettings.AppSettings("MailPwd")
NewMail.SmtpServer = ConfigurationSettings.AppSettings("MailServer")
message.BodyFormat = Mail.MailFormat.Html
message.From = ConfigurationSettings.AppSettings("FromAddr")
message.Priority = MailPriority.High '指定電子郵件訊息有高優先權
message.To = ToAddr '收件人mail
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", ConfigurationSettings.AppSettings("MailServer"))
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25)
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2)
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", mailID) 'id
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", mailPwd) 'pwd
'mail內容
message.Body = MailBody
message.Subject = MailSubject 'mail主旨

NewMail.Send(message) '寄出mail

----------------
http://forums.microsoft.com/MSDN-CHT/Search/Search.aspx?words=POP3&localechoice=31748&SiteID=14&searchscope=forumscope&ForumID=236
---------------
string fromEmail = "xxx@gmail.com";
string fromName = "Admin";
MailAddress from = new MailAddress(fromEmail, fromName, Encoding.UTF8);



// Mail Reciver
string toEmail = "yyy@gmail.com";
MailMessage mail = new MailMessage(from, new MailAddress(toEmail));



// Mail Message - Subject
string subject = "message subject";
mail.Subject = subject;
mail.SubjectEncoding = Encoding.UTF8;



// Mail Message - Body
string body = "message body";
mail.Body = body;
mail.BodyEncoding = Encoding.UTF8;
mail.IsBodyHtml = false;
mail.Priority = MailPriority.High;



// SMTP Setting
SmtpClient client = new SmtpClient();
client.Host = "smtp.gmail.com";
client.Port = 587;
client.Credentials = new NetworkCredential("xxx@gmail.com", "password");
client.EnableSsl = true;



// Send Mail
client.Send(fromEmail, toEmail, subject, body);
--------------------------
http://teacher.syset.com/viewtopic.mspx?t=1327&sid=c83eee8f9a789b1c79897200a107adb0
http://www.move-to.net/comm/forum/ASP.NET/4083.aspx
http://www.cnblogs.com/netatomy/archive/2008/01/06/1028188.html
http://hi.baidu.com/widebright/blog/item/18d62c73d2addd1c8701b0d1.html

留言

這個網誌中的熱門文章

嘗試卸載資料庫時,發生資料庫正在使用的而無法卸載的可能解決方案

PMP常用的英文單字