Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Email
Message
From
04/08/2005 14:29:38
Terry Tuell
Stephens Production Company
Fort Smith, Arkansas, United States
 
 
To
02/08/2005 23:34:38
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Re: Email
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Miscellaneous
Thread ID:
01037177
Message ID:
01038662
Views:
21
I've just written a program to send E-Mail that so far works very well. The only thing I've found that may be a slight flaw is that MS Outlook must be running, otherwise I get an error.
LOCAL l_oOutLook as OutLook.Application, ;
      l_oNameSpace as Outlook.NameSpace, ;
      l_oFolder as Outlook.MAPIFolder, ;
      l_oMailItem as Outlook.MailItem


l_oOutlook = CREATEOBJECT("Outlook.Application")
l_oNameSpace = l_oOutlook.GetNamespace("MAPI")
l_cMsg = "Whatever you want to say in the Body"
l_oFolder = l_oNameSpace.GetDefaultFolder(6)	&& (o_lFolderInbox)
l_oMailItem = l_oFolder.Items.Add(0) 		&& (o_lMailItem)

WITH l_oMailItem
   .to = "Valid E-Mail Address you supply"
   .Attachments.Add("Any attachment or leave this line out")
   .Body = "Whatever you want to say in your E-Mail"
   .Send()  && Or you can do .Display()
Endwith 

RELEASE l_oOutLook, ;
        l_oNameSpace, ;
        l_oFolder, ;
        l_oMailItem
I found this on the Ted Roche site and found the paper very informative.

I don't know your exact application or need but if you are still having problems sending E-Mail via VFP, I think it would be worth your while to download and read.

http://www.tedroche.com/Present/2002/OutlookAutomationWithVisualFoxPro.pdf
Previous
Reply
Map
View

Click here to load this message in the networking platform