CDONTS - PDF Attachment / decoding problem

K

Kyle Pula

I am using CDONTS to send email from an ASP script.

Attached to each of these emails is a 34K PDF file. 90% of the time
the file arrives intact. 10% of the time, however, users are unable
to open the file.

It appears that users using some sort of webmail recieve an improperly
decoded version of the file where as users of POP3 non-web email
clients (e.g. Outlook) generally recieve the file intact.

Thus far, all users reporting errors have up-to-date versions of Adobe
Reader and are able to read the PDF file if I resend it from my
desktop out of Outlook.

I have tried to open the files some users have reported problems with
(after they forward me the copy they received) and I have the same
problem. The file size on the PDF that could not be opened had grown
to 47K.

Code is pasted below.

I would appreciate any help.
Thanks, Kyle.

' -------- Send Email w/ Attachment Code ------------

dim objSendMail, tmpSubj, tmpFrom
set objSendMail = Server.CreateObject("CDONTS.NewMail")
With objSendmail
.From = eFrom
.To = eTo
.Cc = eCC
.Bcc = eBCC
.Subject = eSubj
.AttachFile(eAttach)

'If HTML Email then add HTML properties
if instr(1,eBody,"<HTML>",1) <> 0 then
.BodyFormat = cdoBodyFormatHTML
.MailFormat = cdoMailFormatMIME
end if
.Body = eBody
.Send
End With
set objSendMail = nothing
' ---------- End Code --------------
 
J

jbongran

Kyle said:
I am using CDONTS to send email from an ASP script.

Attached to each of these emails is a 34K PDF file. 90% of the time
the file arrives intact. 10% of the time, however, users are unable
to open the file.

It appears that users using some sort of webmail recieve an improperly
decoded version of the file where as users of POP3 non-web email
clients (e.g. Outlook) generally recieve the file intact.

Thus far, all users reporting errors have up-to-date versions of Adobe
Reader and are able to read the PDF file if I resend it from my
desktop out of Outlook.

I have tried to open the files some users have reported problems with
(after they forward me the copy they received) and I have the same
problem. The file size on the PDF that could not be opened had grown
to 47K.

Code is pasted below.

I would appreciate any help.
Thanks, Kyle.

' -------- Send Email w/ Attachment Code ------------

dim objSendMail, tmpSubj, tmpFrom
set objSendMail = Server.CreateObject("CDONTS.NewMail")
With objSendmail
.From = eFrom
.To = eTo
.Cc = eCC
.Bcc = eBCC
.Subject = eSubj
.AttachFile(eAttach)

'If HTML Email then add HTML properties
if instr(1,eBody,"<HTML>",1) <> 0 then
.BodyFormat = cdoBodyFormatHTML
.MailFormat = cdoMailFormatMIME
end if
.Body = eBody
.Send
End With
set objSendMail = nothing
' ---------- End Code --------------

Call the attachFile method after setting the MailFormat property, since this
property set the encoding method applied to the file
http://msdn.microsoft.com/library/d...etlocaleids_method_cdonts_newmail_object_.asp
Hope this help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top