I have a program that monitors another program to see if it is running. When it the second program is turned off I have the first to send out an email message. However, when it does so, Outlook says "This program is trying to send a message on your behalf, this could be a virus, do you wish to allow the message to be sent?" and then pauses waiting for the operator to say yes. I need to cancel this alert and automatically send the message without asking. Some portions of the code are printed below.
Sub MailAlert()
'You must add a reference to the Microsoft outlook Library
Dim OutApp As Outlook.Application, RSviewApp As Object
Dim OutMail As Outlook.MailItem
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
' more code here
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Sub MailAlert()
'You must add a reference to the Microsoft outlook Library
Dim OutApp As Outlook.Application, RSviewApp As Object
Dim OutMail As Outlook.MailItem
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
' more code here
Set OutMail = Nothing
Set OutApp = Nothing
End Sub