At 14:31 10.11.2002, Oliver Witt said:
>I wrote a php script that's supposed to enable me to attach files to an
>email. However, the attached files ends up being a mess of letters.
>"Hallo" becomes "SGFsbG8=". That must have to do with encoding. Is that
>a common problem or do you need the entire script?

It seems that you're encoding the file somehow - that's usual, even
required if your file is a binary file (like a picture, or a formatted

In your mail headers, you should see some MIME like

        Content-Type: multipart/alternative;

("alternative" could also read "related" - depends on the content, the
"multipart" is the point here)

which would tell the client browser that the next mail consists of a couple
of separate parts, with a separator line as "--GU4wuTSk68F".

Next comes the message entity, which starts with such a separator line, and
a set of MIME headers for the respective entity:

        Content-Disposition: inline
        Content-Transfer-Encoding: 7bit
        Content-Type: text/plain

        You are receiving this message as a subscriber
        to the Just For You Network. To cancel, see the
        instructions at the end of this mail.

That's the first part of the mail - it's plain text. The next part would be
an image, and again starts with a boundary:

        Content-Type: image/jpeg;
        Content-Transfer-Encoding: base64
        Content-Disposition: attachment;



The message should also end with a boundary, but most mail client's omit

For more information consult RFC2045 ff about MIME

Hope this helps,

   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to