Sending email - escaping characters
| From: | Rohan Amin | Date: | Thu, 27 Jul 2000 18:16:18 +0000 |
| Subject: | Sending email - escaping characters | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-8627@lists.php.net to get a copy of this message | ||
Hello,
I am having a bit of a problem and I can't figure it out, although I am sure
the solution is easy:
I have one page called email.php and it has a text area for the body of an
email message. The "To" and "Subject" Fields are pre filled out.
I have another page called send_email.php and it has a line that will send
the email:
mail($TO_EMAIL,$SUBJECT,$BODY, "From: \"You\"
<\"you@yourcompany.com\">\n");
If the $BODY of the message (the text that the user types in) has either a '
or a " the email will come with a \' and a \".
How do I prevent the escaping of the characters?
I tried the following:
mail("$TO_EMAIL","$SUBJECT","$BODY", "From: \"You\"
<\"you@yourcompany.com\">\n");
mail('$TO_EMAIL','$SUBJECT','$BODY', "From: \"You\"
<\"you@yourcompany.com\">\n");
Neither of those works.
Thanks for your help.
Rohan :-)