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
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 :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.