king.oslo Posted January 12, 2010 Share Posted January 12, 2010 Hello, I was wondering how to prevent mail() function from escaping quotes and other special letters in emails: <?php $msg = 'This is a message with a "quote" that will be escaped automatically'; $mail = mail($to, $subject, $message, $header); //This will send an email with the message: //'This is a message with a \"quote\" that will be escaped automatically' ?> Thanks, Marius Link to comment https://forums.phpfreaks.com/topic/188202-mail-function-escapes-symbols-in-messages/ Share on other sites More sharing options...
Catfish Posted January 12, 2010 Share Posted January 12, 2010 not sure on this one. i thought yo ucould use stripslashes but mail() doesn't return a string. there doesn't seem to be anything in the manual about switching the escaping off from what i can see. are you sure it is mail() that is escaping the string? if it isn't you can likely try: $mail = mail($to, $subject, stripslashes($message), $header); Link to comment https://forums.phpfreaks.com/topic/188202-mail-function-escapes-symbols-in-messages/#findComment-993693 Share on other sites More sharing options...
king.oslo Posted January 12, 2010 Author Share Posted January 12, 2010 You were right, it wasn't the mail function that did this. I used the stripslashes() function like you said, and all went well Thanks, Marius Link to comment https://forums.phpfreaks.com/topic/188202-mail-function-escapes-symbols-in-messages/#findComment-993774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.