mypointofview
09-08-2005, 05:27 AM
Working on an email reply form using PHP...
You should always include a new line character at the end of the "From:" field. Above is a quote from CYPHIX, a very helpful member from this forum. Full thread here. (http://http://www.codingforums.com/showthread.php?p=353234)
When doing this, the first line in the incoming email is empty. It's just an esthetical thing but that started me wondering -- WHY this advice?
I read on a PHP official page that acually both \n and \r should be used. See here (http://us2.php.net/function.mail). Or do I understand it wrong? Here's what the PHP offical page says:
additional_headers (optional) [...] Multiple extra headers should be separated with a CRLF (\r\n). I'm a beginner and just puzzled -- how to understand that :eek:
Question 1: Is the advice to use the new line character after the from field designed to prevent unauthorized email injection ?
Question 2: Is it thus "safer" to use both \n and \r ?
Thanks, Martin.
You should always include a new line character at the end of the "From:" field. Above is a quote from CYPHIX, a very helpful member from this forum. Full thread here. (http://http://www.codingforums.com/showthread.php?p=353234)
When doing this, the first line in the incoming email is empty. It's just an esthetical thing but that started me wondering -- WHY this advice?
I read on a PHP official page that acually both \n and \r should be used. See here (http://us2.php.net/function.mail). Or do I understand it wrong? Here's what the PHP offical page says:
additional_headers (optional) [...] Multiple extra headers should be separated with a CRLF (\r\n). I'm a beginner and just puzzled -- how to understand that :eek:
Question 1: Is the advice to use the new line character after the from field designed to prevent unauthorized email injection ?
Question 2: Is it thus "safer" to use both \n and \r ?
Thanks, Martin.