|
回复 1# guozilu
我也遇到类似问题啦,请问各位有没有解决方法呀?
发邮件时总会有一个安全警告提示(outlook2003),需要人工确认,有什么办法可以不弹出这个警告呢?代码如下:
Function SendEmail(SendTo, Subject, Body, Attachment)
Dim objOutlook
Dim objOutlookMsg
Dim olMailItem
' Create the Outlook object and the new mail object.
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
Set mapi = objOutlook.GetNameSpace("MAPI")
' Define mail recipients
objOutlookMsg.To = SendTo
' Body of the message
objOutlookMsg.Subject = Subject
objOutlookMsg.Body = Body
If (Attachment <> "") Then
objOutlookMsg.Attachments.Add(Attachment)
End If
'Display the email
objOutlookMsg.Display
' Send the message
objOutlookMsg.Send
' Release the objects
'objOutlook.quit
Set objOutlook = Nothing
Set mapi = Nothing
End Function |
|