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!

Send attachment via CDO

Status
Not open for further replies.
May 11, 2004
37
US
I need to send an attachment w/ where the filename is the name of the machine (.xml). Is it possible to use a variable like strMachine and use that in the filename? I don't know the correct syntax...


Set objEmail = CreateObject("CDO.Message")
objEmail.From = "richard.rekos@questionmark.com"
objEmail.To = "richard.rekos@questionmark.com"
objEmail.Subject = "AT Output"
objEmail.Textbody = "AT Output"
objEmail.AddAttachment "c:\assettracker\data\strMachine.xml"
objEmail.Send

WScript.quit
 
Replace this:
objEmail.AddAttachment "c:\assettracker\data\strMachine.xml"
By this:
objEmail.AddAttachment "c:\assettracker\data\" & strMachine & ".xml"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top