Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP to Outlook
Message
De
07/01/2005 16:00:52
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Titre:
VFP to Outlook
Divers
Thread ID:
00975256
Message ID:
00975256
Vues:
116
Hello all,

The codes below to send an attached Excel file to Outlook email, it works fine except always me to confirm in Outlook with 2 screens asked :

First screen : from microsoft Outlook

A program is trying to access email-addresses you have stored in Outlook.
Do you want to allow this ?
If this is unexpected, it may be a virus and you should choose "No".

Allow access for

YES NO HELP
----------------------------------------------
Second screen : from Microsoft OutLook

A program is trying to send automatically send email on your behalf

Do you want to allow this ?
If this is unexpected, it may be a virus and you should choose "No".


YES NO HELP


How to get rid of the 2 above screens from Microsoft Outlook ?

Any help or suggestions would be greatly appreciated

Tia

CODES started
*==============================================
FUNCTION SendExcelFileByMail
*==============================================
LOCAL lcProfile, lcPassword, lcExcelFile, lcSubject, lcBody, lcIini_file, lnRecipients, lcbuffer
LOCAL loApp, loNameSpace, loMailItem

lcProfile 		= ""
lcPassword 		= ""
lcSubject 	= "TEST to send Excel File"

lcExcelFile	=  getini("MEM_VAR", "MEM_EXCELFILE", gcIni)

lcbody= " this is a test to send Excel File"
			
loApp 		= CREATEOBJECT("Outlook.Application")
loNameSpace	= loApp.GetNameSpace("MAPI")
loNameSpace.Logon(lcProfile , lcPassword)
loMailItem 	= loApp.CreateItem(0)

lcRecipient	=getini("MEM_VAR", "MEM_RECIPIENT", gcIni)
lnRecipients=OCCURS(",", lcRecipient)

IF lnRecipients > 0

	FOR i=1 TO lnRecipients+1
		DO CASE
			CASE i=1

				lcbuffer=SUBSTR(lcRecipient,1,AT(",",lcRecipient,i)-1)
				loMailItem.Recipients.ADD(lcbuffer)

			CASE i=lnRecipients+1
				lcbuffer=ALLTR(SUBSTR(lcRecipient, AT(",",lcRecipient,i-1)+1))
				loMailItem.Recipients.ADD(lcbuffer)

			OTHERWISE
				lcbuffer=ALLTR(SUBSTR(lcRecipient, AT(",",lcRecipient,i-1)+1 ,  ;
										AT(",",lcRecipient,i)-AT(",",lcRecipient,i-1) -1))
				loMailItem.Recipients.ADD(lcbuffer)
		ENDCASE
	ENDFOR
ELSE
	loMailItem.Recipients.ADD(lcRecipient)
ENDIF

loMailItem.Subject	= lcSubject
loMailItem.Body 	= lcBody

loMailItem.Attachments.ADD(lcExcelFile, 1, 1, "gamm_active_and_stop")

loMailItem.SEND
loNameSpace.Logoff

RETURN
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform