Remove vbs confirmation box script

I have the following code where I can send mail through my configured Outlook. I can start this vbs using a rule in my prediction, which in turn will send an email to the email specified in the script

But I get a confirmation window asking for a virus or not when running this script to send mail.

How to get rid of this confirmation window to always allow sending emails.

   Dim ToAddress
Dim MessageSubject
Dim MessageBody
Dim MessageAttachment

Dim ol, ns, newMail

ToAddress = "John.Smith@place.com"   ' change this...
MessageSubject = "My Subject"
MessageBody = "DATA"

Set ol = WScript.CreateObject("Outlook.Application")
Set ns = ol.getNamespace("MAPI")
ns.logon "","",true,false
Set newMail = ol.CreateItem(olMailItem)
newMail.Subject = MessageSubject
newMail.Body = MessageBody & vbCrLf

' validate the recipient, just in case...
Set myRecipient = ns.CreateRecipient(ToAddress)
myRecipient.Resolve
If Not myRecipient.Resolved Then
   MsgBox "unknown recipient"
Else
   newMail.Recipients.Add(myRecipient)
   newMail.Send
End If

Set ol = Nothing

      

+1


a source to share


1 answer


I believe you have built-in security features that Microsoft installed a couple of years ago with a security patch. The only way I know is to digitally sign the code and then import the certificate that was used to sign that code into the certificate store, or better yet, use the Redemption DLL . From the Redemption DLL website:

Outlook Redemption works around limitations imposed by Outlook Security Patch and Service Pack 2 MS Office 98/2000 and Office 2002/2003/2007 (including Security Patch) plus provides a number of objects and functions to work with properties and functionality not through the Outlook object model.

The DLL can be downloaded from here: http://www.dimastr.com/redemption/download.htm and if you look around you can find some examples of how to use it, Here's to get you started: http: // www .utteraccess.com / forums / printthread.php? Cat = & Board = 80 & main = 409393 & type = thread



Also take a look at the posted and answered questions:

How to avoid Outlook security warning when reading Outlook message from C # program

Outlook Scroll Dialogue About Macro

+1


a source







All Articles