acroporas Posted February 15, 2007 Share Posted February 15, 2007 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 More sharing options...
Kemm Posted February 15, 2007 Share Posted February 15, 2007 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 Link to comment https://forums.phpfreaks.com/topic/38634-email-form-and-symbols/#findComment-185471 Share on other sites More sharing options...
Balmung-San Posted February 15, 2007 Share Posted February 15, 2007 stripslashes() should do just what you need. Link to comment https://forums.phpfreaks.com/topic/38634-email-form-and-symbols/#findComment-185474 Share on other sites More sharing options...
Kemm Posted February 15, 2007 Share Posted February 15, 2007 stripslashes() should do just what you need. You are really helpfull Balmung-San! Thanks! Link to comment https://forums.phpfreaks.com/topic/38634-email-form-and-symbols/#findComment-185475 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.