Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send email from Outlook
Message
From
27/02/2002 22:10:17
 
 
To
27/02/2002 20:41:51
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00626134
Message ID:
00626153
Views:
18
>Could somebody point me in the right direction. I want to be able to send an email message from within a foxpro application.

Using Outlook, follow this sample:
#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!"

   * Note that the fully qualified path and file is required.
   .Attachments.Add("c:\mydir\sample.txt")

   .Send
ENDWITH
You can also use Nigel Coates MAPI class as Sergey pointed out.
Another choice is using SMTP with wwIPStuff from Rick Strahl
http://www.west-wind.com

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
Next
Reply
Map
View

Click here to load this message in the networking platform