Php mail() MIME shows cleartext headers

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am struggling with the php mail function so to allow a multipart mime
settings where both the message and any set of attachments can be
Teorically, I'd know how to do. I build up my headers and pass them as
the fourth argument of the function mail().

Practically, what happens is that whenever I try to test my script
emailing myself, what appears in the email body are the __cleartext__

ůMaybe you spot in them something wrong, this is what in an email body
appears (and should not) in cleartext:
MIME-Version: 1.0

Content-Type: multipart/alternative;


This is a MIME encoded message


Content-Type: text/plain; charset="iso-8859-1"


type your message here


please note that with
Content-Type: multipart/mixed;
or that with
Content-Transfer-Encoding: 7bit
nothing would change, all would still appear cleartext in the email
body (testing both eudora and outlook).


Re: Php mail() MIME shows cleartext headers

*** Alberto wrote/escribió (Tue, 17 May 2005 11:33:35 GMT):
Quoted text here. Click to load it

I've never tried myself but I suppose you just need to create headers for
the first attachment. The headers for the rest of them are embedded in
message body.

-- Álvaro G. Vicario - Burgos, Spain
-- - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group

Re: Php mail() MIME shows cleartext headers

Nope it doesn't work.
Anyone has the url of a decent tutorial abou it? i do not need the
application, I need to understand how it works. Hoever I add headers, they
show up cleartext!

Quoted text here. Click to load it

Re: Php mail() MIME shows cleartext headers

Quoted text here. Click to load it

The message headers passed to the API need to say:

  MIME-Version: 1.0
  Content-Type: multipart/alternative;

EVERYTHING else, including the "This message is MIME encoded" warning, the
boundary markers, and the individual subpart headers, are just part of the
message body.  To the e-mail system, they are just text.
- Tim Roberts,
  Providenza & Boekelheide, Inc.

Re: Php mail() MIME shows cleartext headers

Alberto wrote:
Quoted text here. Click to load it

Your problem may be the blank lines between header lines.  AFAIK, a
blank line indicates the end of that particular header.

Try sending yourself an email with similar attachments (they don't have
to be identical) and look at the source for both the working and failing

Check your message header, also - ensure it's set up properly.  If you
still can't find anything, send me a failing message at the email below
and I'll take a look at it.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline