Answer the question
In order to leave comments, you need to log in
How to implement message body encoding when sending with mail() function?
Good day!
Help with the encoding of the body of the message, EXACTLY the body of the message.
I searched, but apart from the from and subject encoding, there is nothing.
Required :
$to = '[email protected]';
$subject= 'subject';
$msg = "Message text"; // set the encoding for the content of this variable!!!
mail($to, $subject, $msg, 'From: '.$email);
Thanks in advance and sorry if this is a simple question.
Answer the question
In order to leave comments, you need to log in
/* Для отправки HTML-почты вы можете установить шапку Content-type. */
$headers= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* дополнительные шапки */
$headers .= "From: Birthday Reminder <[email protected]>\r\n";
$headers .= "Cc: [email protected]\r\n";
$headers .= "Bcc: [email protected]\r\n";
/* и теперь отправим из */
mail($to, $subject, $message, $headers);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question