Re: Re: CONTENT-type for sending HTML attachments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Angelo Zanetti wrote:


Jon Anderson wrote:
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




Thanks jon, thats what im trying to do... However with the adding attachemnt you can specify the content type. I have used text/html and application/octet-stream to force them to be as attachments. They seem to work in my webmail but when opened with thunderbird I get a whole long message with binary. Is that a thunderbird problem or is there inconsistencies in the way web clients and mail clients read attachments and mime types?

Im going to try my Gmail account and see what I get... Thanks again. If you have any other advise that I might be missing that'll be great.

Thanks

This is a "feature" of some email clients.

By default, some will display html, images, documents,... inline rather then as the wanted attachment.

In Thunderbird, look under the View menu at the top.
See the entry about half way down "Display Attachments Inline" ??

This will mess with what you, the email creator, is attempting to do.

--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree.

- Rush

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux