Re: mail() php in message

From: Date: Mon, 13 Oct 2003 07:35:57 +0000
Subject: Re: mail() php in message
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-165934@lists.php.net to get a copy of this message
Manuel Lemos wrote:
Hello, On 10/13/2003 05:02 AM, Onno Kuipers wrote:
My server runs PHP and Mysql. Normaly I can put some php in my .php-files wich will create a html file for the clients. (you all know this of course). My question now is: How can I put that html (created with PHP) in the message off the mail.
To not have to change your PHP code, you may capture the HTML you want to mail by enclosing your PHP code between a ob_start() and a ob_get_clean() commands, like this: ob_start(); ... your code here: $message=ob_get_clean(); And then use the $message variable to compose an HTML message. Sending an HTML message properly requires that you compose a message according to the MIME standards. Just try this class that makes it easy: http://www.phpclasses.org/mimemessage
thanx a lot! I think this will help.

« previous php.general (#165934) next »