翻譯|使用教程|編輯:況魚(yú)杰|2020-01-09 16:58:57.557|閱讀 299 次
概述:MailBee Objects是一個(gè)組件集合。本文將會(huì)展示該產(chǎn)品中簡(jiǎn)單電子郵件、HTML電子郵件和來(lái)自文件的HTML電子郵件三種電子郵件的示例。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
MailBee Objects是一個(gè)組件集合。您可以使用該控件創(chuàng)建并將郵件發(fā)送到SMTP服務(wù)器并從POP3服務(wù)器接收、解析以及刪除電子郵件,還能在IMAP4服務(wù)器上管理電子郵件以及文件夾。它同樣支持SSL以及S/MIME以獲得更好的安全性能。MailBee控件能在ASP、VB、C++或任何支持ActiveX技術(shù)的語(yǔ)言中使用。
簡(jiǎn)單的電子郵件
本示例發(fā)送不帶附件的純文本電子郵件。為簡(jiǎn)單起見(jiàn),不使用SMTP身份驗(yàn)證,并且不執(zhí)行錯(cuò)誤檢查。
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郵件
本示例發(fā)送不帶附件的HTML電子郵件,SMTP.BodyFormat是示例的關(guān)鍵屬性。為簡(jiǎn)單起見(jiàn),不使用SMTP身份驗(yàn)證,并且不執(zhí)行任何錯(cuò)誤檢查。
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 %
來(lái)自文件的HTML電子郵件
該示例發(fā)送從HTML文件導(dǎo)出的HTML電子郵件。
如果HTML文件包含對(duì)圖像,腳本,CSS文件和其他對(duì)象的引用,則它們將作為嵌入式附件與電子郵件一起嵌入。SMTP.ImportBodyText是示例的關(guān)鍵屬性。為簡(jiǎn)單起見(jiàn),不使用SMTP身份驗(yàn)證,并且不執(zhí)行錯(cuò)誤檢查。
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 %>
以上就是本次教程的全部?jī)?nèi)容,接下來(lái)會(huì)有更多相關(guān)教程,敬請(qǐng)關(guān)注!您也可以在評(píng)論留下你的經(jīng)驗(yàn)和建議。除了本教程,想要了解更多電子郵件相關(guān)產(chǎn)品信息的可以點(diǎn)擊此處查看。有更多教程資源等著你!
==========================================
如果想要購(gòu)買正版授權(quán)MailBee.NET Objects的朋友,可以聯(lián)系
關(guān)注慧聚IT微信公眾號(hào) ???,了解產(chǎn)品的最新動(dòng)態(tài)及最新資訊。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: