Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email with attachment

Status
Not open for further replies.

pasu

Programmer
Aug 9, 2003
17
US
I want use FoxPro to call outlook to send email out with multiple Microsoft Word file as attachment. Does anyone knows how to do it?
 
pasu

It might be worth it if you spent a few minutes looking at the FAQ section, there are a few examples of automating Outlook, like faq184-766 and faq184-1768 and faq184-1769 or this:
Code:
#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


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top