Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get Outlook to actually send messages in the OutB
Message
From
03/10/2006 15:56:40
 
 
To
03/10/2006 11:47:28
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01158911
Message ID:
01159092
Views:
33
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform