Re: Need help tracking down a Mail_Mime bug

From: Date: Tue, 18 May 2004 22:17:33 +0000
Subject: Re: Need help tracking down a Mail_Mime bug
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29371@lists.php.net to get a copy of this message
Ian Eure wrote:
Today I tried to send a HTML message using Mail_Mime. It didn't work out quite how I had hoped. I'm working from the example provided in the Mail_Mime end-user documentation. The message came through, but the MIME portions display as text, as if the mail client doesn't recognize the message contains MIME parts at all. The same thing happens with KMail, Mozilla Mail, and Apple Mail. I sent a test HTML message with MozMail, and it worked fine. Examining both messages, it appears that the problem is with the Content-Type header. It's set to multipart/alternative; boundary="------------090109010104070403030703" in the message from MozMail, but it's completely blank in the message sent with Mail/Mail_Mime. It can't be getting stripped by my SMTP server, since MozMail sent it's message using it, and it came through fine there. Digging around a bit more, it appears that the headers that I'm passing Mail (from Mail_Mime::headers()) do, in fact, have the Content-Type set correctly. But it's still blank in the message when I receive it. As a test, I sent a plain text message with Mail, and set the Content-Type header to 'text/plain'. It came through fine in the resulting message. What's going on here? Where is the Content-Type header getting lost, and why is it only when it's coming from Mail_Mime?
Are you trying to set the multipart content type yourself? If so, you shouldn't be. All you have to do is use setHTMLBody() and it will automatically set up the content type(s) for you. If you also have a setTXTBody(), you'll get a multipart/alternative message. -- paperCrane <Justin Patrin>

« previous php.pear.dev (#29371) next »