原創(chuàng)|使用教程|編輯:黃竹雯|2017-04-27 15:40:50.000|閱讀 961 次
概述:該文主要介紹了MailBee.NET Objects中使用SMTP服務器發(fā)送消息的代碼示例,Smtp對象提供了多種方法和屬性來調整優(yōu)化發(fā)送消息的過程。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
C#:
Smtp mailer = new Smtp();
VB.NET:
Dim mailer As New Smtp()
C#:
mailer.SmtpServers.Add("mail.domain.com");
VB.NET:
mailer.SmtpServers.Add("mail.domain.com")
mailer.SmtpServers.Add("mail.domain.com", "jdoe", "secret");
VB.NET:
mailer.SmtpServers.Add("mail.domain.com", "jdoe", "secret")
C#:
mailer.Message.From.AsString = "jdoe@domain.com";
mailer.Message.To.AsString = "bill@domain.com";
mailer.Message.Subject = "Hi";
mailer.Message.BodyPlainText = "Hello Bill";
mailer.Message.From.AsString = "John Doe <jdoe@domain.com>";
mailer.Message.To.AsString = "Bill <bill@domain.com> (Company Inc), Kathy <kathy@server.com>";
mailer.Message.Subject = "The document";
mailer.Message.BodyHtmlText = "<html>The document body</html>";
mailer.Message.From.Email = "jdoe@domain.com";
mailer.Message.From.DisplayName = "John Doe";
mailer.Message.To.AsString = "Kathy <kathy@server.com>";
mailer.Message.Cc.Add("bill@domain.com", "Bill Smith");
mailer.Message.Subject = "News";
mailer.Message.BodyPlainText = "News body";
VB.NET: mailer.Message.From.AsString = "jdoe@domain.com" mailer.Message.To.AsString = "bill@domain.com" mailer.Message.Subject = "Hi" mailer.Message.BodyPlainText = "Hello Bill" mailer.Message.From.AsString = "John Doe <jdoe@domain.com>" mailer.Message.To.AsString = "Bill <bill@domain.com> (Company Inc), Kathy <kathy@server.com>" mailer.Message.Subject = "The document" mailer.Message.BodyHtmlText = "<html>The document body</html>" mailer.Message.From.Email = "jdoe@domain.com" mailer.Message.From.DisplayName = "John Doe" mailer.Message.To.AsString = "Kathy <kathy@server.com>" mailer.Message.Cc.Add("bill@domain.com", "Bill Smith") mailer.Message.Subject = "News" mailer.Message.BodyPlainText = "News body"
C#:
mailer.Send();
VB.NET:
mailer.Send()
試用、下載、了解更多產品信息請點擊""
本站文章除注明轉載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn