By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,723 Members | 1,414 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,723 IT Pros & Developers. It's quick & easy.

Php mail() MIME shows cleartext headers

P: n/a
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
allowed.
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__
headers.
ů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;
boundary="boundary1650b42c9440*a87e70180d8f1c1189b 4";
Content-Transfer-Encoding: quoted-printable
This is a MIME encoded message
--boundary1650b42c9440a87e7018*0d8f1c1189b4
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
type your message here
--boundary1650b42c9440a87e7018*0d8f1c1189b4--
============
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).
tia
Alberto

Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
*** Alberto wrote/escribió (Tue, 17 May 2005 11:33:35 GMT):
Teorically, I'd know how to do. I build up my headers and pass them as
the fourth argument of the function mail().


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
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #2

P: n/a
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!
tia
"Alvaro G Vicario" <al******************@telecomputeronline.com> ha scritto
nel messaggio news:1e******************************@40tude.net.. .
*** Alberto wrote/escribió (Tue, 17 May 2005 11:33:35 GMT):
Teorically, I'd know how to do. I build up my headers and pass them as
the fourth argument of the function mail().


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
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--

Jul 17 '05 #3

P: n/a
"Alberto" <no****@nospam.nospam> wrote:

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!


The message headers passed to the API need to say:

MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="boundary1650b42c9440*a87e70180d8f1c1189b 4"
Content-Transfer-Encoding: quoted-printable

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, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 17 '05 #4

P: n/a
Alberto wrote:
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
allowed.
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__
headers.
ů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;
boundary="boundary1650b42c9440*a87e70180d8f1c1189b 4";
Content-Transfer-Encoding: quoted-printable
This is a MIME encoded message
--boundary1650b42c9440a87e7018*0d8f1c1189b4
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
type your message here
--boundary1650b42c9440a87e7018*0d8f1c1189b4--
============
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).
tia
Alberto

Alberto,

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
messages.

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.
js*******@attglobal.net
==================
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.