Jump to content

mail function escapes symbols in messages


king.oslo

Recommended Posts

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

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

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.