Hello friends,
can anyone tell me, how to attach a file to email using "CDONTS.Newmail" I tried several times and refered several and did the same thing as it says. but it did n't work. here is the code i used:
set objMail = Createobject("CDONTS.NewMail")
objMail.From = "
[email protected]"
objMail.To = recipient
objMail.Subject = subject
objMail.BodyFormat = cdoBodyFormatHTML
objMail.Body = message & htmlMessage
objMail.Importance = CdoHigh
objMail.MailFormat = CdoMailFormatMIME
objMail.AttachFile "C:\temp\file1.txt"
objMail.Send
the error is :
error '80004005'
Unspecified error.
this error happens only when i use 'objMail.AttachFile "C:\temp\file1.txt" '.
please reply me soon if anybody knows about this
Thanks
joseph