Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29929

PHP Mail header for emails with special characters in the subject or message

$
0
0

My code:

$to      = 'example@example.com';
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
$header = "From: noreply@example.com\r\n"; 
$header.= "MIME-Version: 1.0\r\n"; 
$header.= "Content-Type: text/html; charset=ISO-8859-1\r\n"; 
$header.= "X-Priority: 1\r\n"; 

mail($to, $subject, $message, $header);

When i send a mail with special characters such as ®ð-˚©-ʼ“æ,˚ˍðß©, in the message, it works but spacing is no longer dealt with (every new line or space gets removed) And the second problem is that the special characters are not displayed in the subject. They just output like: øʼªʼ

Thanks in advance!


Viewing all articles
Browse latest Browse all 29929

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>