You are here: mime multipart shows up as attachment « PHP Programming Language « IT news, forums, messages
mime multipart shows up as attachment

Posted by Der tolle Emil on 12/17/68 11:54

Hi!

I wrote a little function to send emails which works quite well. I already
managed to send attachments correctly (also more than 1 per email) but I am
not able to send a HTML mail containing a text only block for non-HTML
clients. I will not post the PHP code as I think it is irrelevant, the error
lies within the mail header and/or body, so here is the mail I do want to
send:

FROM: me <foo@bar.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="MIME_BOUNDARY"
--MIME_BOUNDARY
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

This is a multi-part message in MIME format.
navision://client/run?etcetc

--MIME_BOUNDARY
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

<html><body>
<a href="navision://client/run?etcetc">click me</a>
</body></html>

--MIME_BOUNDARY--

The first 3 lines are passed as the header to PHP's mail() function, whereas
the rest is passed as the body (starting with the first --MIME_BOUNDARY
line). If I send a mail this way I get the mail with the text/plain part
displayed and an ATT<random#>.html attachment containing the text/html part.

What exactly am I doing wrong?

Thank you!
Klaus.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация