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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding attachment to mail

Status
Not open for further replies.

EC1

Programmer
Jul 22, 2002
25
BE
Hi,

this is the code i use to send mail from VFP.
Can i add attachment to the mail?

Thanks


cSubject = "Mail using VFP"
cAddress = "name@site.be"
cBody = "Eddy : this is a mail from foxpro"
DO doMail WITH cSubject,cAddress,cBody
**********************************************************
PROCEDURE doMail
PARAMETERS cSubject, cAddress, cBody
o=createobject("outlook.application")
oitem=o.createitem(0)
oitem.subject= cSubject
oitem.to= cAddress
oitem.body= cBody
*
oitem.send
o=.null.
RETURN

 
HI
See my FAQ on this.
How can I send an Email using OUTLOOK from VFP?
faq184-766


It has code as to how you can make multiple attachments.
:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
EC1

o=createobject("outlook.application")
oitem=o.createitem(0)
oItem.Attachments.Add("c:\autoexec.bat") &&Full path required
oitem.subject= cSubject
oitem.to= cAddress
oitem.body= cBody
oitem.send
o=.null.
RETURN
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks !!!

I suppose there a lot more properties like attachments.add.
Could you tell me where i can find out?

Thanks
 
EC1

1. If you have VFP7.0 (or VFP8.0), Intellisense can help you determine the properties and methods.
2. Take a look at FAQ184-1737
3. If you have MS Office installed, there is a help file that describes most of the properties (D:\Program Files\Microsoft Office\Office10\1033\VBAOL10.chm) Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike, Ramani,

thanks a lot !!!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top