Re: does your mail() base64 encode messages?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Try mail("me@xxxxxxxxxx","test script","Foo!");

Thanks very much for your suggestion- It did not fix the problem but
it provided a pointer to a workaround.

It appears that my host base64 encodes message bodies if any sort of
header- even an empty one- is supplied. This is a problem the sysadmin
is looking into but for now I have to live with it.

The empty header caused mail() to put a \n in between the headers and
the MIME headers for the base64 encoded stuff. This in turn caused
mail readers to view the message as a plain text message that happened
to contain a base64 encoded string so the recipient saw gibberish.
Removing the empty header resulted in a plain text message, putting a
valid header in the headers parameter caused the mail to be viewed by
the mail reader as a normal base64 encoded message and thus readable
by the recipient. Unfortunately mail()'s habit of doing this base64
encoding precludes me from doing anything with MIME multipart messages
because all the multipart separators, HTML etc become visible as plain
text, but at least I can send emails containing plain text.

And so to the commercial application which originally showed up this
problem. Its mail code had an extra \n at the end of its headers.
Removing this made it possible for it to send plain text emails,
albeit base64 encoded ones, from this host. I've used this application
from quite a few other customers hosts in the past so this \n is not
normally a problem, but I've never used a host that exhibits this
behaviour. As well as removing this \n I had to comment out the lines
that sent multipart emails but at least now I'm in business.

As to the problem itself, I'm none the wiser. As I see it it can only
be either PHP or Sendmail that is doing this. I've never had this or
any other version of PHP do this to me before but since as I
understand it Sendmail is only being used as a mail relay here I cant
place the blame anywhere else but a possible bug in PHP 4.3.10's
mail() function. It's not a bug, it's a feature!:)

I guess it's all extra experience.
John W. List

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux