Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tripping over Outlook's Security w multiple e-mails
Message
From
08/10/2004 12:38:18
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Tripping over Outlook's Security w multiple e-mails
Miscellaneous
Thread ID:
00949943
Message ID:
00949943
Views:
52
I've been tasked with sending out e-mails to our customers. I'm pulling the e-mail addresses, invoking an OLE object to send the e-mail, and am getting the following warning message:

"A program is trying to automatically send e-mail on your behalf. Do you want to allow this?

If this is unexpected, it may be a virus and you should choose "No".

Now, if this only fired once, I wouldn't mind, it would be a mere annoyance. Unfortunately, it fires for every single e-mail. Any ideas on resolving this?

The emailer is written in VFP7. We are using Outlook, with Microsoft Exchange Server (Sp 3). Here is the code invoking the email.
oOutLookObject = CreateObject("Outlook.Application") 
oNamespace = oOutlookObject.GetNamespace("MAPI")
oFolder = oNamespace.GetDefaultfolder(6)

IF glTested
** Need to Build Email Address File first....
	USE c:\temp\EmailSource
	
	lnCont = MESSAGEBOX('You will be sending ' + TRANSFORM(RECCOUNT()) + ' emails.  Continue?', 20)
	IF lnCont = 6
		SCAN
			oEmailItem = oOutLookObject.CreateItem(MAILITEM)
			gcWhoTo = ALLTRIM(EmailAddr)
			IF llAttach
				WITH oEmailItem 
					.To = gcWhoTo
					.Subject = lcHeader
					.Importance = IMPORTANCENORMAL 
					.Body = lcBody
					.Attachments.Add(lcAttachment) 
					.Send 
				ENDWITH 
			  ELSE
				WITH oEmailItem 
					.To = gcWhoTo
					.Subject = lcHeader
					.Importance = IMPORTANCENORMAL 
					.Body = lcBody
					.Send
				ENDWITH
			ENDIF
		ENDSCAN
		THISFORM.Commandgroup1.command2.Enabled = .F.
	ENDIF
"It came to pass"
Next
Reply
Map
View

Click here to load this message in the networking platform