note 57080 added to ref.mail

From: Date: Fri, 23 Sep 2005 02:54:32 +0000
Subject: note 57080 added to ref.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-95638@lists.php.net to get a copy of this message
I'm getting information from a form and passing it to the $body. Then, once it emails it, it loses stuff. Here's what I've got: [code] $to = "bmrust@gmail.com"; $subject = "Test"; $body = "Name: $name\n"; $headers = "From: ".$email."\r\n"; if (mail($to, $subject, $body, $headers)) { echo("<p>You have been entered!</p>"); } else { echo("<p>Message delivery failed...</p>"); } [/code] However, if there is a space " " in $name, like "John Smith" it cuts off after "John" in the email. When I echo the information to the page, however, it comes out "John Smith". So, I know it is in the string, but I cannot pass it correctly to the email. Please help! ---- Manual Page -- http://www.php.net/manual/en/ref.mail.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57080 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57080&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57080&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57080&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57080&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57080&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57080&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57080&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57080&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95638) next »