翻譯|使用教程|編輯:況魚杰|2020-01-09 16:58:57.557|閱讀 299 次
概述:MailBee Objects是一個組件集合。本文將會展示該產品中簡單電子郵件、HTML電子郵件和來自文件的HTML電子郵件三種電子郵件的示例。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
MailBee Objects是一個組件集合。您可以使用該控件創建并將郵件發送到SMTP服務器并從POP3服務器接收、解析以及刪除電子郵件,還能在IMAP4服務器上管理電子郵件以及文件夾。它同樣支持SSL以及S/MIME以獲得更好的安全性能。MailBee控件能在ASP、VB、C++或任何支持ActiveX技術的語言中使用。
簡單的電子郵件
本示例發送不帶附件的純文本電子郵件。為簡單起見,不使用SMTP身份驗證,并且不執行錯誤檢查。
Visual Basic:
Dim objSMTP ' Create mailer component Set objSMTP = CreateObject("MailBee.SMTP") ' Unlock SMTP component objSMTP.LicenseKey = "put your license key here" ' Set SMTP server name objSMTP.ServerName = "mail.server.com" ' Set message properties objSMTP.FromAddr = "me@mydomain.com" objSMTP.ToAddr = "you@yourdomain.com" objSMTP.Subject = "Hi" objSMTP.BodyText = "This is test message" ' Send it! objSMTP.SendASP:
<% Dim objSMTP ' Create mailer component Set objSMTP = Server.CreateObject("MailBee.SMTP") ' Unlock SMTP component objSMTP.LicenseKey = "put your license key here" ' Set SMTP server name objSMTP.ServerName = "mail.server.com" ' Set message properties objSMTP.FromAddr = "me@mydomain.com" objSMTP.ToAddr = "you@yourdomain.com" objSMTP.Subject = "Hi" objSMTP.BodyText = "This is test message" ' Send it! objSMTP.Send %>
HTML郵件
本示例發送不帶附件的HTML電子郵件,SMTP.BodyFormat是示例的關鍵屬性。為簡單起見,不使用SMTP身份驗證,并且不執行任何錯誤檢查。
Visual Basic:
Dim objSMTP ' Create mailer component Set objSMTP = CreateObject("MailBee.SMTP") ' Unlock SMTP component objSMTP.LicenseKey = "put your license key here" ' Set SMTP server name objSMTP.ServerName = "mail.server.com" ' Set message properties objSMTP.FromAddr = "me@mydomain.com" objSMTP.ToAddr = "you@yourdomain.com" objSMTP.Subject = "Message in HTML format" ' Set HTML format for the body objSMTP.BodyFormat = 1 ' Place HTML contents into the body objSMTP.BodyText = "This word is bold" ' Send it! objSMTP.SendASP:
<% Dim objSMTP ' Create mailer component Set objSMTP = Server.CreateObject("MailBee.SMTP") ' Unlock SMTP component objSMTP.LicenseKey = "put your license key here" ' Set SMTP server name objSMTP.ServerName = "mail.server.com" ' Set message properties objSMTP.FromAddr = "me@mydomain.com" objSMTP.ToAddr = "you@yourdomain.com" objSMTP.Subject = "Message in HTML format" ' Set HTML format for the body objSMTP.BodyFormat = 1 ' Place HTML contents into the body objSMTP.BodyText = "This word is bold" ' Send it! objSMTP.Send %
來自文件的HTML電子郵件
該示例發送從HTML文件導出的HTML電子郵件。
如果HTML文件包含對圖像,腳本,CSS文件和其他對象的引用,則它們將作為嵌入式附件與電子郵件一起嵌入。SMTP.ImportBodyText是示例的關鍵屬性。為簡單起見,不使用SMTP身份驗證,并且不執行錯誤檢查。
Visual Basic:
Dim objSMTP ' Create mailer component Set objSMTP = CreateObject("MailBee.SMTP") ' Unlock SMTP component objSMTP.LicenseKey = "put your license key here" ' Set SMTP server name objSMTP.ServerName = "mail.server.com" ' Set message properties objSMTP.FromAddr = "me@mydomain.com" objSMTP.ToAddr = "you@yourdomain.com" objSMTP.Subject = "Message in HTML format" ' Export an HTML file into the e-mail message objSMTP.ImportBodyText "C:\docs\letter.htm", True ' Send it! objSMTP.Send
ASP:
<% Dim objSMTP ' Create mailer component Set objSMTP = Server.CreateObject("MailBee.SMTP") ' Unlock SMTP component objSMTP.LicenseKey = "put your license key here" ' Set SMTP server name objSMTP.ServerName = "mail.server.com" ' Set message properties objSMTP.FromAddr = "me@mydomain.com" objSMTP.ToAddr = "you@yourdomain.com" objSMTP.Subject = "Message in HTML format" ' Export an HTML file into the e-mail message objSMTP.ImportBodyText "C:\docs\letter.htm", True ' Send it! objSMTP.Send %>
以上就是本次教程的全部內容,接下來會有更多相關教程,敬請關注!您也可以在評論留下你的經驗和建議。除了本教程,想要了解更多電子郵件相關產品信息的可以點擊此處查看。有更多教程資源等著你!
==========================================
如果想要購買正版授權MailBee.NET Objects的朋友,可以聯系
關注慧聚IT微信公眾號 ???,了解產品的最新動態及最新資訊。
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: