Re: How do you send stylized email?
| From: | Daniel Brown | Date: | Tue, 26 Feb 2008 14:52:28 +0000 |
| Subject: | Re: How do you send stylized email? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-270155@lists.php.net to get a copy of this message | ||
On Tue, Feb 26, 2008 at 9:28 AM, tedd <tedd@sperling.com> 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;
--
</Dan>
Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>