Re: How do you send stylized email?

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

 



I want to send a styled email via heredoc, can that be done?

$message = <<<EOT
Title: This is a title of the Event.
Time: This the time of the Event.

Please show up on time.
EOT

mail('example@xxxxxxxxxxx' , 'An Event' , $message);

If so, how do you style it?

If not, how do you send stylized email?

The easiest way is this:

$message = <<<EOT
<span style="color: red">
Title: This is a title of the Event.
Time: This the time of the Event.
</span>

Please show up on time.
EOT

mail('example@xxxxxxxxxxx' , 'An Event' , $message, 'Content-Type:
text/html');

If you want to send multipart text/HTML emails, have a look at my
website for the HTMLMimeMail class which greatly simplifies this.

--
Richard Heyes
http://www.phpguru.org
Free PHP and Javascript code

--
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