View Single Post

  #1 (permalink)  
Old 11-15-2004
Damien
 
Posts: n/a
Default Sending multipart html emails with PHP script

Hi to all,
After hours of attempts and "googling", I'm still pulling my hair off my
head when I try to send multipart html emails.

It "works" on PCs with Outlook when I juste send a single "related"
mail: one part for the HTML body, and several for the images. However,
the images do not show on a Mac.

I also wanted to have an "alternate", plain text message. I've tried the
method described by Zend and PHPBuilder, but no luck...

I've included a sample of what the email looks like in the end.

Questions: what is the best way to organize the multiparts? Where does
the header stop and the message start ?

Many thanks in advance !
BR,
Damien

MIME-Version: 1.0
From: "Me" <me@truc.net>
Subject: My subject

Content-Type: multipart/alternative; boundary="PIEALT57206"
This is a mulipart message in mime format

--PIEALT57206

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

Your mail software is not HTML....

--PIEALT57206

Content-Type: multipart/related; boundary="PIEREL57206"

--PIEREL57206

Content-Type: text/html

Content-Transfer-Encoding:8bit

(html code here)

--PIEREL57206

Content-Type: image/jpeg; name="logo.jpg"
Content-Transfer-Encoding: base64
Content-Description: "Image num.9"
Content-ID: Image9

(base64 encoded image)


--PIEREL57206--

--PIEALT57206--
Reply With Quote