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!

sending multiple attachments

Status
Not open for further replies.

FILIPM

Programmer
Mar 11, 2003
40
BE
Hi Guys,

My boss has a new toy, namely me.
I make offers in vfp7 and make de report with crystal reports.
Then I send the PDF or word file like this :
m.xxattach="c:\foxprow\"+ALLTRIM(m.ccklant)+ALLTRIM(STR(m.ccbonnr,10,0))+".PDF"
xxattach=m.xxattach
oCRApp = CREATEOBJECT("crystalruntime.application")
oRep = oCRApp.OpenReport("offer.rpt")
oExport = oRep.Exportoptions()
oExport.Destinationtype = 1
oExport.FormatType = 31
oExport.Diskfilename = "&xxattach"
orep.Export(.F.)
m.xxmail =ALLTRIM(m.ccoemail)
m.xxsubject ="OFFERTE"
m.xxbody ="BLABLABLA..."

THEN SENDING THE MAIL :
cSubject = m.xxsubject
cAddress = m.xxmail
cBody = m.xxbody
cattach=m.xxattach
DO doMail WITH cSubject,cAddress,cBody

**********************************************************
PROCEDURE doMail
PARAMETERS cSubject, cAddress, cBody
o=createobject("outlook.application")
oitem=o.createitem(0)
oitem.Attachments.Add("&cattach") &&Full path required
oitem.subject= cSubject
oitem.to= cAddress
oitem.body= cBody
oitem.send
o=.null.
RETURN
**********************************************************
so far no problem.
Now my boss want to send in the same email all the technical things about every article.
This can be a word document, a pfd file or a web-site address.
Is it possible to send more than 1 attachments in 1 email:
For example : The offer in pdf format
article 1 : technical in word document
article 2 : technical in an website address
article 3 : technical in a pdf file

Any help would be very greatfull,


FILIP MERLIER
 
Just Add another Attachment as shown below:

PROCEDURE doMail
PARAMETERS cSubject, cAddress, cBody
oOutlook = CreateObject("Outlook.Application")
oItem = oOutlook.CreateItem(0)
oItem.Attachments.Add("&cAttach1") &&Full path required
oItem.Attachments.Add("&cAttach2") &&Full path required
oItem.Subject = cSubject
oItem.to = cAddress
oItem.body = cBody
oItem.Send
RELEASE oOutlook
RETURN

Good Luck


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top