Re: Re: CONTENT-type for sending HTML attachments

From: Date: Tue, 20 Mar 2007 13:28:59 +0000
Subject: Re: Re: CONTENT-type for sending HTML attachments
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-250910@lists.php.net to get a copy of this message
Angelo Zanetti wrote:
So if the HTML files are attachments and the text is just plain text then will the content-type of the message be text/plain and then each attachment be multipart/alternative. Please note that the HTML files need to be sent as attachments and not part of the body. On my email client I was receiving the emails correctly (IE: message body and HTML files as attachments) but on my client's email client they were just receiving blank messages. I'm just a little confused about the content types as you might have gathered.
You're trying to do this, right? MIME Email -> Part 1: Text Message (The message that you want displayed) -> Part 2: HTML Attachment -> Part 3: HTML Attachment -> ... -> Part N: HTML Attachment Because it's a mime email, your text part will be a mime part (an attachment) as well, but basically any mail reader these days will render that as the main part. You want your main email ("MIME Email" above) to have a multipart/alternative content type. Your text part ("Part 1" above) should be text/plain. Each HTML part ("Part 2" to "Part N" above) could be text/html. If you want to force those HTML parts as attachments you could use application/octet-stream for the content type - mail readers should treat them as binary. Whatever mime class you're using should hopefully take care of any encoding that may or may not be necessary. jon

« previous php.general (#250910) next »