On 10/29/2003 11:05 PM, Ebestel wrote:
I want to send HTML output from a php script as HTML E-Mail "ONLINE" Like Send this page by email feature.
You may just capture the HTML of the pages, maybe with ob_start() and ob_getcontents() functions and then send the HTML in an e-mail messages. Since you probably have relative URLs to images on the site, you need to use the <base> tag in your page header so the mail programs that receive the message can locate the images in the site.
Now, to send the actual message you should not send it like some people do just adding a Content-type: text/html header to the message, as many spam filters will discard your message before it gets to the recipients.
You need to compose an multipart/alternative message, that consists of your message HTML part and an alternative text part that is shown by mail programs that do not support displaying HTML messages.
You can put anything in the alternative text part, even if it is just a message saying: this is an HTML message, you need an HTML capable mail program to read it. What matters is that providing a text/plain alternative part using multipart messages is mandatory if want to prevent that your message gets filtered.
Composing multipart/alternative messages is not trivial, but fortunately you can resort to ready to use classes like this one that simplifies the composition of multipart messages:
http://www.phpclasses.org/mimemessage
--
Regards, Manuel Lemos
Free ready to use OOP components written in PHP http://www.phpclasses.org/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php