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

Email Attachment

Status
Not open for further replies.

falinskip

MIS
May 29, 2002
4
US
Hi there,

I can't seem to get this code to work, Does anyone know how to send an email attachment without using smtp?

Thanks,

Paul


Set objEmail = CreateObject("CDO.Message")
objEmail.From = "testsrv@co.oakland.mi.us"
objEmail.To = "user@co.oakland.mi.us"
objEmail.Subject = "testsrv Server down"
objEmail.Textbody = "Server1 is no longer accessible over the network."
objEmail.Configuration.Fields.Item _
(" = 2
objEmail.Configuration.Fields.Item _
(" = _
"emailbox.co.oakland.mi.us"
objEmail.Configuration.Fields.Item _
(" = 25

'*************************************8
Set objAttachment = objMessage.Attachments.Add("Attached File", , _
MsgFileData,"c:\data\Weekly.xls")

Set objAttachment = objMessage.Attachments.Add("Linked File", , _
MsgFileLink, "\\odin\xldata\Weekly.xls")

Set objAttachment = objMessage.Attachments.Add("Embedded File", , _
MsgOLE, "c:\data\Weekly.xls")
'objMessage.Update
'objMessage.Send

objEmail.Configuration.Fields.Update
objEmail.Send
 
First, where did the variable objMessage come from?

Next, where did you define (or initialize if they're variables) the constants MsgFileData, MsgFileLink, and MsgOLE? Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top