Re: using html in mail_body

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

 



Hello,

On 12/07/2004 12:32 AM, Ross Hulford wrote:
I am using the mail() function in php and I am looking for a quick and easy way to make the mail_body of an auto response email with HTML tags in it so I can add some style to it.

Sure, but be warned that to compose HTML messages properly you have to include an alternative text part using multipart/alternative messages for e-mail programs that do not support HTML only messages. Actually this is important for you because most modern spam filters discard HTML only messages.


You may want to try this class that simplifies the task of composing and sending HTML messages with alternative text parts.

http://www.phpclasses.org/mimemessage


Are the use of CSS tags possible too?

Yes, but if those come from a separate file, either you refer the full URL of the CSS in your site or you can embed the CSS as a related part within the message, just like you can do embedded images, using multipart/related message parts.


The class that I mentioned demonstrates how to embed image files within the message to be referenced in the HTML with a special cid: URL. You can do the same embedding CSS files so your message can be viewed by HTML e-mail programs even when the users are offline. See the test_html_mail_message.php script for a complete commented example.


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux