Re: sending mail from localhost
| From: | Daniel Brown | Date: | Wed, 13 Jun 2007 14:14:24 +0000 |
| Subject: | Re: sending mail from localhost | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-256861@lists.php.net to get a copy of this message | ||
On 6/13/07, Robert Cummings <robert@interjinn.com> wrote:
On Wed, 2007-06-13 at 09:51 -0400, Daniel Brown wrote: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-8107It's also not necessary to combine single and double quotes withjoin 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@example.com"; $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. |`------------------------------------------------------------'