VB6 MSOUTL.OLB发送邮件
我正在使用MSOUTL.OLB库发送邮件 使用的代码如下所示:VB6 MSOUTL.OLB发送邮件,vb6,outlook,Vb6,Outlook,我正在使用MSOUTL.OLB库发送邮件 使用的代码如下所示: Public Sub SendErrorLogToMailRecipients() Dim errorReportText As String Dim fso As FileSystemObject Set fso = New FileSystemObject Dim txtStrm As TextStream Set txtStrm = fso.OpenTextFile(frmMain.LogFileLocationF
Public Sub SendErrorLogToMailRecipients()
Dim errorReportText As String
Dim fso As FileSystemObject
Set fso = New FileSystemObject
Dim txtStrm As TextStream
Set txtStrm = fso.OpenTextFile(frmMain.LogFileLocationFromRBT, ForReading, False, TristateTrue)
errorReportText = txtStrm.ReadAll
Call txtStrm.Close
If clsCom.IsStringEmpty(gstrErrorMailRecipients) Or clsCom.IsStringEmpty(errorReportText) Then
Exit Sub
End If
Dim mItm As MailItem
On Error GoTo EH
Set mItm = outlApplication.CreateItem(olMailItem)
mItm.Save
With mItm
.To = gstrErrorMailRecipients
.Subject = "[[Express Claim Mail Process Error]]"
.Body = errorReportText
.BodyFormat = olFormatPlain
.Send
End With
Exit Sub
EH:
Call frmMain.LogErrorAcrossUsingRBT("SendErrorLogToMailRecipients")
End Sub
问题提示我在Outlook中收到以下阻止我发送邮件的邮件:
一个程序正在尝试代表您自动发送电子邮件。
你想允许这样吗?
如果这是意外情况,可能是病毒,您应该选择“否”
通过API访问邮箱时,我收到了类似的错误。我的变通方法是使用。问题是我不想使用专业版
谢谢。可能对你有用 请参见此处:OLB不是库,只是类型/接口信息。您正在使用Outlook。