Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automating Outlook 6
Message
From
20/03/2005 12:36:12
 
 
To
20/03/2005 08:24:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP
Miscellaneous
Thread ID:
00997669
Message ID:
00997684
Views:
17
This message has been marked as the solution to the initial question of the thread.
>Does anybody know a way how I can send email from my vfp 6 application using automation when Microsoft Outlook 6 is installed on a Windows XP machine?

Example:
#DEFINE MAILITEM 0
#DEFINE IMPORTANCELOW 0
#DEFINE IMPORTANCENORMAL 1
#DEFINE IMPORTANCEHIGH 2

oOutLookObject = CreateObject("Outlook.Application")
oEmailItem = oOutLookObject.CreateItem(MAILITEM)

WITH oEmailItem
   .Recipients.Add("moe@3stooges.com") && uses the Recipients collection
   .Subject = "Automation sample"
   .Importance = IMPORTANCENORMAL
   .Body = "This is easy!"
   .Attachments.Add("c:\mydir\sample.txt") && Note that the fully qualified path and file is required.
   .Send
ENDWITH

RELEASE oEmailItem
RELEASE oOutLookObject
This is assuming you are referring to MS Outlook. If instead you are referring to Outlook Express, that is a completely different animal. It is not a COM server or client and cannot be automated this way.You can therefore use MAPI.


HTH


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Reply
Map
View

Click here to load this message in the networking platform