note 58094 deleted from function.mail by jome

From: Date: Mon, 24 Oct 2005 09:08:45 +0000
Subject: note 58094 deleted from function.mail by jome
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-97502@lists.php.net to get a copy of this message
Note Submitter: njt1982 at yahoo dot com Reason: useless ---- I recently had an issue with this function where I was creating a message in the form: <?php $message = "blah"; $message .= "blah"; $message .= "blah"; $message .= "blah"; $message .= "blah"; ?> However, eventually the string $message ended up being more than 1000 characters long. I did not realise this was an issue and I have wasted 2 days of my life trying to figure out why a rogue "! " (exclamation mark + space) appeared in the middle of a word for litterally no reason. I did find out that if I inserted text before it, the problem shifted relatively as though it seemd to be "attached" to the beginging. The solution was to create a new line after every concatenation. This was suggested further down these notes - thanks!!! <?php $message = "blah\\n"; $message .= "blah\\n"; $message .= "blah\\n"; $message .= "blah\\n"; $message .= "blah\\n"; ?> To sum up, whenever you use the above method to create your message, ALWAYS put a "\\n" at the end of the line. Also try to keep the lines short. For example: It might take another 2 seconds to type the extra "\\n" in, but it would have saved me 2 days of my life (and a few clumps of hair too)

« previous php.notes (#97502) next »