Greetings all!

I created a form that sends an email using the mail() function. When I receive the mail, all the apostraphes and quotes have a backslash in front of them.

A ' looks like \'

I have a good idea for why it does it, but not how to get rid of it. Any suggestions are greatly appreciated. Thanks!

Rab

    Hi,

    magic quotes might be enabled. You might need to use the php function stripslashes to remove the slashes before you send the mail.

      I think you have set Mail content type equal to something else then "Plain Text"

      By default when u send mail using php mail() function, it set the mail content type to "text/plain" which doesn't show any backslashes before quotes.

      Please check it. It can be set in last optional argument of mail() function.

        Thanks for the replies, here's the portion of the code I'e tried without success...

        $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; 
        $message = stripslashes($message);
        mail($Reciever, $subject, $message, $headers);

        This doesn't seem to work. I've also tried using htmlspecialchars()

        Suggestions?

        Rab

          hmm... why dont you test with:

          mail($Reciever, $subject, "It's my message!", $headers);

          actually, is your $message variable coming from the $GET, $POST or $_COOKIE arrays?

            try this instead

            mail($Reciever, $subject, stripslashes($message), $headers); 
            
              Write a Reply...