CDO.AddAttachment Problem

Ask a Question related to ASP Components, Design and Development.

  1. #1

    Default CDO.AddAttachment Problem

    I have a .ASP page that allows users to upload a file to a SQL Server
    database in Image format. From there, I have a VB6 application that
    queries this table, writes the file using ADODB.Stream, and attaches
    the document to an email using objMail.AddAttachment. This works fine
    75% of the time.

    Occassionally, I encounter a problem where the email looks like the
    following:

    Date: Fri, 24 Feb 2006 06:28:21 -0600
    Message-ID: <000601c6393d$cc889810$28b4040a@mysite.com>
    MIME-Version: 1.0
    Content-Type: multipart/mixed;
    boundary="----=_NextPart_000_0007_01C6390B.81EE2810"
    X-Mailer: Microsoft CDO for Windows 2000
    Thread-Index: AcY5Pcxp2seUW02LSL2g0g7LH/bzDQ==
    Content-Class: urn:content-classes:message
    X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
    X-OriginalArrivalTime: 24 Feb 2006 12:28:21.0596 (UTC)
    FILETIME=[CCA791C0:01C6393D]

    This is a multi-part message in MIME format.

    ------=_NextPart_000_0007_01C6390B.81EE2810
    Content-Type: multipart/alternative;
    boundary="----=_NextPart_001_0008_01C6390B.81EE2810"


    ------=_NextPart_001_0008_01C6390B.81EE2810
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit

    MESSAGE BODY

    ------=_NextPart_001_0008_01C6390B.81EE2810
    Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit

    MESSAGE BODY

    ------=_NextPart_001_0008_01C6390B.81EE2810--

    ------=_NextPart_000_0007_01C6390B.81EE2810
    Content-Type: application/octet-stream;
    name="filename.xls"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
    filename="filename.xls"

    0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAAEAAAAAQAAAAAAAAAA
    EAAAbwEAAAQAAAD+////AAAAAAAAAABiAAAA4wAAAIABAAD/////////////////////////////
    ////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////9
    ////bgEAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACw AAAAwAAAANAAAADgAAAA8A
    AAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAA AZAAAAGgAAABsAAAAcAAAAHQAA
    AB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACQAAAAlAAAAJgAAAC cAAAAoAAAAKQAAACoAAAArAAAA
    LAAAAC0AAAAuAAAALwAAADAAAAAxAAAAMgAAADMAAAA0AAAANQ AAADYAAAA3AAAAOAAAADkAAAA6
    AAAAOwAAADwAAAA9AAAAPgAAAD8AAABAAAAAQQAAAEIAAABDAA AARAAAAEU
    ....
    ....
    ....


    Any ideas why some emails are corrupted and some are not?

    Thanks,
    Robert

    robert.l.jones@gmail.com Guest

  2. Similar Questions and Discussions

    1. contribute problem - access denied file may not existpermission problem
      Recieving the following error message - "access denied file may not exist , or there could be a permission problem" this happened this morning ,...
    2. Problem playing Quicktime thru .DCR embedded in HTML - pathreferencing problem?
      Greetings earthlings and Director heads. Here's the problem: created an HTML file containing shockwave (dcr) movie that calls quicktime movies in...
    3. Uploading problem = weird warning (was: access denied problem.....)
      Hi, I had a problem where my upload form was not working on our production server but was working on two other servers, after checking the...
    4. #21611 [Opn]: Problem with version_compare() (Was: Problem with pear cli and release numbers)
      ID: 21611 Updated by: et@php.net -Summary: Problem with pear cli and release numbers Reported By: jan at horde...
    5. Problem with Apache Web Server config file and PHP (please give advice on what problem may be me)
      HI: Can anyone refer me to someone that can help with the problem below. I installed Apache Web Server on my laptop which has Windows XP. I...
  3. #2

    Default Re: CDO.AddAttachment Problem

    >
    > ------=_NextPart_000_0007_01C6390B.81EE2810
    > Content-Type: application/octet-stream;
    > name="filename.xls"
    > Content-Transfer-Encoding: base64
    > Content-Disposition: attachment;
    > filename="filename.xls"
    >
    >
    0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAAEAAAAAQAAAAAAAAAA
    >
    EAAAbwEAAAQAAAD+////AAAAAAAAAABiAAAA4wAAAIABAAD/////////////////////////////
    >
    ////////////////////////////////////////////////////////////////////////////
    >
    ////////////////////////////////////////////////////////////////////////////
    >
    ////////////////////////////////////////////////////////////////////////////
    >
    ////////////////////////////////////////////////////////////////////////////
    >
    ////////////////////////////////////////////////////////////////////////////
    >
    ////////////////////////////////////////////////////////////////////////////
    >
    ///////////////////////////////////////////////////////////////////////////9
    >
    ////bgEAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACw AAAAwAAAANAAAADgAAAA8A
    >
    AAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAA AZAAAAGgAAABsAAAAcAAAAHQAA
    >
    AB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACQAAAAlAAAAJgAAAC cAAAAoAAAAKQAAACoAAAArAAAA
    >
    LAAAAC0AAAAuAAAALwAAADAAAAAxAAAAMgAAADMAAAA0AAAANQ AAADYAAAA3AAAAOAAAADkAAAA6
    > AAAAOwAAADwAAAA9AAAAPgAAAD8AAABAAAAAQQAAAEIAAABDAA AARAAAAEU
    > ...
    > ...
    > ...
    > Any ideas why some emails are corrupted and some are not?
    >
    > Thanks,
    > Robert
    What makes you think this is corrupted. Looks like correct base64 encoding
    to me

    Anthony.


    Anthony Jones Guest

  4. #3

    Default Re: CDO.AddAttachment Problem

    This is supposed to be a .xls attachment. I don't understand why when
    I use objEmail.AddAttachment it writes the file to the email body like
    this.

    robert.l.jones@gmail.com Guest

  5. #4

    Default Re: CDO.AddAttachment Problem


    <robert.l.jones@gmail.com> wrote in message
    news:1141937164.149688.27780@i39g2000cwa.googlegro ups.com...
    > This is supposed to be a .xls attachment. I don't understand why when
    > I use objEmail.AddAttachment it writes the file to the email body like
    > this.
    >
    This header:-

    Content-Type: multipart/mixed;
    boundary="----=_NextPart_000_0007_01C6390B.81EE2810"

    Says that the body of the email has mutliple parts. Each part is seperated
    by the boundary value ----=_NextPart_000_0007_01C6390B.81EE2810

    then:-

    ------=_NextPart_000_0007_01C6390B.81EE2810
    Content-Type: application/octet-stream;
    name="filename.xls"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
    filename="filename.xls"

    This indicates that a new bodypart is about to begin. The headers show that
    the part is encoded as base64 and is an attachment with the nominal file
    name of filename.xls.

    It all seems to be in order.

    Anthony.


    Anthony Jones Guest

  6. #5

    Default Re: CDO.AddAttachment Problem

    If all is in order, then why isn't the document attached to the email
    rather than being written to the body?

    robert.l.jones@gmail.com Guest

  7. #6

    Default Re: CDO.AddAttachment Problem

    If all is in order, then why isn't the document attached to the email
    rather than being written to the body?

    robert.l.jones@gmail.com Guest

  8. #7

    Default Re: CDO.AddAttachment Problem


    <robert.l.jones@gmail.com> wrote in message
    news:1141946999.290924.225180@p10g2000cwp.googlegr oups.com...
    > If all is in order, then why isn't the document attached to the email
    > rather than being written to the body?
    >
    Robert,

    An SMTP mail message is utlimately a simple stream of of bytes.

    This message is a mime multipart message.

    The document IS attached. What I described to you is how attachments work
    in an mime multipart messages.

    What were you expecting it to look like?

    Anthony.


    Anthony Jones Guest

  9. #8

    Default Re: CDO.AddAttachment Problem

    The message should just contain the email body with a document attached
    and the standard link to download the attachment. These messages do
    not have a link to download the attachment. Instead, the attachment is
    written to the body in base64. The email body contains all of the MIME
    header information. How do I make it quit doing that?? When these
    messages are received, they just look like a bunch of base64 garbage
    and not an actual document.

    This is actually in the message body!

    0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAAEAAAAAQAAAAAAAAAA

    EAAAbwEAAAQAAAD+////AAAAAAAAAABiAAAA4wAAAIABAAD/////////////////////////////

    robert.l.jones@gmail.com Guest

  10. #9

    Default Re: CDO.AddAttachment Problem

    I think I've found the problem. There was a line-feed at the end of my
    subject.

    robert.l.jones@gmail.com Guest

  11. #10

    Default Re: CDO.AddAttachment Problem


    <robert.l.jones@gmail.com> wrote in message
    news:1142012042.201447.102590@v46g2000cwv.googlegr oups.com...
    > I think I've found the problem. There was a line-feed at the end of my
    > subject.
    >
    Ahh I see. I thought you were showing the raw data but you were actually
    showing us the what an email program thought was the body.



    Anthony Jones Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139