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

Another mail attachment problem with CDONTS

Status
Not open for further replies.

snix1

Programmer
Dec 12, 2000
107
0
0
US
Hi! I have a script that sends out email using CDONTS and uploads a file for an attachement, in this case a WORD file. My file is uploaded correctly to the server and the email is sent ok and I receive it. It looks as if the WORD file is on the email message, it has a size, etc. When I download it and open it, the attachment is empty.

I downloaded my uploaded file directly using an FTP program and was able to open it ok in WORD...just can't get it when it's an attachment. By the way, I can upload up to 3 files and it appears to work, except when I try to download them from the email message.

Any ideas?

Here's my code:
dim objMail
set objMail = Server.CreateObject("CDONTS.Newmail")
objMail.From = "myaddress@myaddr.org"
objMail.To = "myemail@mydomain.com"
objMail.Subject = strSubject
if blnFile1 = TRUE then
objMail.AttachFile Server.MapPath("/emailattach/" & SavedFilename1)
end if
if blnFile2 = TRUE then
objMail.AttachFile Server.MapPath("/emailattach/" & SavedFilename2)
end if
if blnFile3 = TRUE then
objMail.AttachFile Server.MapPath("/emailattach/" & SavedFilename3)
end if
objMail.MailFormat = 0
objMail.BodyFormat = 0
objMail.Body = strMessage
objMail.Send
set objMail = nothing

THANKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top