Jump to content

Email Form and " ' symbols


acroporas

Recommended Posts

I have a "contact me" form.  The user fills in the from, clicks submit and I have Php email it to me.  Here's the code I use to send the email.

 

$headers = "From: " . $_POST["from"];
mail($MyEmailAddress,$_POST["Subject"],$_POST["body"],$headers);

 

This works fine, in that it sends me the email.  However when there are " or ' symbols in the message, they are sent as \" or \'

 

Why does this happen, and how do I fix it so that the email recieved shows " and '.

 

Also, are there other symbols that I will discover later on don\'t work either.

Link to comment
https://forums.phpfreaks.com/topic/38634-email-form-and-symbols/
Share on other sites

I have a "contact me" form.  The user fills in the from, clicks submit and I have Php email it to me.  Here's the code I use to send the email.

 

$headers = "From: " . $_POST["from"];
mail($MyEmailAddress,$_POST["Subject"],$_POST["body"],$headers);

 

This works fine, in that it sends me the email.  However when there are " or ' symbols in the message, they are sent as \" or \'

 

Why does this happen, and how do I fix it so that the email recieved shows " and '.

 

Also, are there other symbols that I will discover later on don\'t work either.

 

 

I actually have the same problem with my HTML to Text converter.

All " & ' has a backslash in front of it. Would also appricate some help with

this :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.