multipart mime mail problem

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

Threaded View
Hi, on windows xp I'm using

xampp v 1.6.4

I'm trying to send mail.  The mail always sends, but the multipart
sections are broken.  Essentially, I want to send an html email that
has a link it, like so the reader can click on
the link.

When I get the email, the body is empty.

It seems that No matter what I can't get multiple newlines before the
boundry sections.
I've tried just \n, just \r, \r\n, \r\n\r\n, \n\n and more
Perhaps the problem isn't the newlines?

I had some code that worked on linux, but I've never got it to work on

The code and email follow.

Can anyone tell me how to get this working?


// Code Start

define("CRLF", chr(0x0D) . chr(0x0A));

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
" ">

<html xmlns=" ">



$body = "From: chupper@localhost" . CRLF .
    "MIME-Version: 1.0" . CRLF .
    "Content-Type: multipart/alternative; " . CRLF .
    "    boundary=\"----=_Part_15337_8253480.1197250275132\"" . CRLF .


// Message End

Re: multipart mime mail problem

ceh wrote:
Quoted text here. Click to load it
Why not use one of the many HTML email classes that are already out there in  
the internet?

Re: multipart mime mail problem

Quoted text here. Click to load it

Well, I was using an html email class that works on unix...  I just
can't get it to work on windows.

Re: multipart mime mail problem


on 12/10/2007 08:55 PM ceh said the following:
Quoted text here. Click to load it

You may want to try this very popular class that works under anything
and deals with line breaks correctly:


Manuel Lemos

Metastorage - Data object relational mapping layer generator

PHP Classes - Free ready to use OOP components written in PHP

Re: multipart mime mail problem

I seem to have this working now.

It seems I had to enable the following line in my php.ini...
This doesn't makes sense to me though because it says for unix only

; For Unix only.  You may supply arguments as well (default: "sendmail
-t -i").
sendmail_path = "d:\xampp\sendmail\sendmail.exe -t"

Additionally, if I ran a local smtp server before this change, the
mails were routed, they were just broken.

I also read elsewhere that php mail talks directly to the mta.  This
implies to me the smtp server.  perhaps that's an incorrect

So, why is it I need to use the local sendmail exe when the php mail
call was working, at least sending email without it?


Site Timeline