Re: How do you send stylized email?

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

 



At 9:52 AM -0500 2/26/08, Daniel Brown wrote:
On Tue, Feb 26, 2008 at 9:28 AM, tedd <tedd@xxxxxxxxxxxx> wrote:
 Hi gang:

  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

    Without beating the subject to death, since you've already gotten
two good answers, I'll add in that your HEREDOC (aside from being
prone to a parse error due to the missing semicolon after the closing
EOT) will end immediately after `please show up on time.`

    Even though you started EOT on it's own line as is required, the
last carriage return/newline will not be included in $message.  If you
want an ending newline (which I consider a Good Idea[tm]), then change
the above to:

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

Please show up on time.

EOT;

Yeah, but that was just a first draft. I never write anything that runs the first time. :-)

It keeps me sharp, or dull, as the case may be.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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