How do I get around outlook security prompt. This is the function I am calling to send an email. I would like it to be silent or macro around it.
VBStart
Function CreateEmail(strRecipient, strSubject, strBody, strAttachment )
'Create OL App object
Set objOLApp = CreateObject("Outlook.Application")
OlSecurityManager.DisableOOMWarnings = True
If objOLApp is nothing then
MsgBox "Could not create OL App. Shutting Down"
Exit Function
End If
'Create a new mail item
Set objMsg = objOLApp.CreateItem(0)
If objMsg is nothing then
MsgBox "Could not create Mail Item. Shutting Down"
Exit Function
End If
'Set basic message parameters
objMsg.To = strRecipient
objMsg.Subject = strSubject
objMsg.Body = strBody
objMsg.Attachments.Add strAttachment,,,"Attachment1"
'Send the message
objMsg.Send
'Free up the space
Set objOLApp = Nothing
Set objMsg = Nothing
CreateEmail = "Success"
End Function
VBEnd
Let>strBody=Here is the error text file for testing. Number of errors are %ErrorAlert%.
VBEval>CreateEmail("%strTo%","%strSubj%","%strBody%","%strAttachment%"),Answer
Outlook Security prompt
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Not sure that there's anyway to avoid it. Blame Microsoft. But do you really need to automate Outlook? Instead use an SMTP server and use the SMTPSendMail command to send the email directly.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?