Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get Outlook to actually send messages in the OutB
Message
De
03/10/2006 15:56:40
 
 
À
03/10/2006 11:47:28
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01158911
Message ID:
01159092
Vues:
34
Hi John,

here's some code I use to send email using outlook:
LOCAL loOutlook as Outlook.application
LOCAL loSpace
m.llDisplayEmails = .F.

m.loOutlook = CREATEOBJECT("Outlook.application")
IF TYPE('loOutLook') <> "O" OR ISNULL(loOutlook)
	=MESSAGEBOX("Could not load Outlook object.")
	RETURN .F.
ENDIF
m.loSpace = m.loOutlook.GetNameSpace("MAPI")
m.loSpace.Logon()
m.loMsg = m.loSpace.GetDefaultFolder(6) && Points to the Inbox

m.loNew = m.loMsg.Items.ADD()

WITH m.loNew
	.Recipients.ADD("fred@somewhere.com")
	m.lnRecipientCount = 1
	.Subject = "Test Message"
	.Body = "Body of email" 
	IF m.llDisplayEmails
		.DISPLAY()
	ELSE
		.SEND()
	ENDIF
ENDWITH
Hope it helps.


>I am sending e-mail messages in MS OutLook through Automation and OutLook is placing the messages in the OutBox, I want to know how to force Outlook to actually send the messages as if I clicked the send/receive button.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform