Re: sending mail from localhost

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

 



On 6/13/07, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
On Wed, 2007-06-13 at 09:51 -0400, Daniel Brown wrote:
>
>     It's also not necessary to combine single and double quotes with
> join marks (.'s) as you have it.  While this isn't the problem, and
> Stut is absolutely correct, your code would look cleaner if you did it
> as follows:
>
> <?
> $to = "nobody@xxxxxxxxxxx";
>
> $subject = "Message Sent From Website";
>
> $message  = "Hi!\n";
> $message .= "\tThis is also an example of how to use double quotes\n";
> $message .= "to encapsulate special characters such as the newline\n";
> $message .= "and tab characters.  If you need to escape \"quotes\" you\n";
> $message .= "simply backslash them like above.  Also, note that this\n";
> $message .= "message can be very long by using the dot before the\n";
> $message .= "equals sign.  Another way to do this would be to use\n";
> $message .= "HEREDOC syntax, or simply use one continuing line,\n";
> $message .= "but that's for another time and another example.\n";

$message  =
    "Hi!\n"
   ."\tThis is also an example of how to use double quotes\n"
   ."to encapsulate special characters such as the newline\n"
   ."and tab characters.  If you need to escape \"quotes\" you\n"
   ."simply backslash them like above.  Also, note that this\n"
   ."message can be very long by using the dot before the\n"
   ."equals sign.  Another way to do this would be to use\n"
   ."HEREDOC syntax, or simply use one continuing line,\n"
   ."but that's for another time and another example.\n";

:B

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'



Yeah, I forgot the dots-and-quotes to single variable option, too.  Thanks!


--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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