CDONTS - PDF Attachment / decoding problem

Discussion in 'ASP General' started by Kyle Pula, Jul 25, 2003.

  1. Kyle Pula

    Kyle Pula Guest

    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 --------------
     
    Kyle Pula, Jul 25, 2003
    #1
    1. Advertising

  2. Kyle Pula

    jbongran Guest

    Kyle Pula wrote:
    > 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
     
    jbongran, Jul 25, 2003
    #2
    1. Advertising

  3. Kyle Pula

    Kyle Pula Guest

    This fixed my problem; thanks a lot.

    "jbongran" <> wrote in message news:<3f2119f4$0$28640$>...
    > Kyle Pula wrote:
    > > 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
     
    Kyle Pula, Jul 28, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. edwinek
    Replies:
    2
    Views:
    285
    Fredrik Lundh
    Aug 4, 2003
  2. Ryan McLean

    asp CDONTS attachment not being sent correctly

    Ryan McLean, Jul 16, 2003, in forum: ASP General
    Replies:
    2
    Views:
    109
    Ryan McLean
    Jul 17, 2003
  3. Dave Karmens

    CDONTS attachment to external image

    Dave Karmens, Feb 25, 2004, in forum: ASP General
    Replies:
    1
    Views:
    123
    Dave Karmens
    Feb 25, 2004
  4. Jammer
    Replies:
    2
    Views:
    227
    Jeff Cochran
    Oct 17, 2004
  5. Alla
    Replies:
    2
    Views:
    103
    Tad McClellan
    Feb 17, 2006
Loading...

Share This Page