翻譯|使用教程|編輯:況魚杰|2020-01-02 10:36:02.833|閱讀 215 次
概述:本教程是組件集合MailBee Objects發(fā)送電子郵件(SMTP)的教程。本文將會介紹如何排除MailBee Objects不能發(fā)送電子郵件的問題。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
MailBee Objects是一個組件集合。您可以使用該控件創(chuàng)建并將郵件發(fā)送到SMTP服務(wù)器并從POP3服務(wù)器接收、解析以及刪除電子郵件,還能在IMAP4服務(wù)器上管理電子郵件以及文件夾。它同樣支持SSL以及S/MIME以獲得更好的安全性能。MailBee控件能在ASP、VB、C++或任何支持ActiveX技術(shù)的語言中使用。
常見的消息未發(fā)送原因為以下因素之一:
您可以從MailBee的日志文件中確定問題的確切原因。要啟用日志記錄,請設(shè)置SMTP對象的EnableLogging和LogFilePath屬性。以下示例使用SMTP驗證發(fā)送簡單的電子郵件。SMTP會話日志被寫入C:\ smtp_log.txt文件中。
Visual Basic:
Dim objSMTP Set objSMTP = CreateObject("MailBee.SMTP") ' Enable logging SMTP session into a file objSMTP.EnableLogging = True objSMTP.LogFilePath = "C:\smtp_log.txt" objSMTP.ClearLog objSMTP.LicenseKey = "put your license key here" ' Set SMTP server name objSMTP.ServerName = "mail.server.com" ' Enable SMTP authentication objSMTP.AuthMethod = 2 ' Set authentication credentials objSMTP.UserName = "jdoe" objSMTP.Password = "secret" ' Set message properties objSMTP.FromAddr = "sender@firstdomain.com" objSMTP.ToAddr = "recipient@seconddomain.com" objSMTP.Subject = "Test" objSMTP.BodyText = "Body of the test message" ' Try to send message If objSMTP.Send Then MsgBox "Sent successfully" Else MsgBox "Error #" & objSMTP.ErrCode & ", " & objSMTP.ErrDesc End If
ASP:
<% Dim objSMTP Set objSMTP = Server.CreateObject("MailBee.SMTP") ' Enable logging SMTP session into a file objSMTP.EnableLogging = True objSMTP.LogFilePath = "C:\smtp_log.txt" objSMTP.ClearLog objSMTP.LicenseKey = "put your license key here" ' Set SMTP server name objSMTP.ServerName = "mail.server.com" ' Enable SMTP authentication objSMTP.AuthMethod = 2 ' Set authentication credentials objSMTP.UserName = "jdoe" objSMTP.Password = "secret" ' Set message properties objSMTP.FromAddr = "sender@firstdomain.com" objSMTP.ToAddr = "recipient@seconddomain.com" objSMTP.Subject = "Test" objSMTP.BodyText = "Body of the test message" ' Try to send message If objSMTP.Send Then Response.Write "Sent successfully" Else Response.Write "Error #" & objSMTP.ErrCode & ", " & objSMTP.ErrDesc End If %>
除了本教程,想要了解更多電子郵件相關(guān)產(chǎn)品信息的可以點擊此處查看。有更多教程資源等著你!
==========================================
如果想要購買正版授權(quán)MailBee.NET Objects的朋友,可以聯(lián)系
關(guān)注慧聚IT微信公眾號 ???,了解產(chǎn)品的最新動態(tài)及最新資訊。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: