note 57080 rejected from ref.mail by jome

From: Date: Fri, 23 Sep 2005 11:59:11 +0000
Subject: note 57080 rejected from ref.mail by jome
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-95654@lists.php.net to get a copy of this message
Note Submitter: bmrust at gmail dot com ---- 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!

« previous php.notes (#95654) next »