Using HTML code in PHP email -
this question exact duplicate of:
is there way can put html code in email message , auto response message? when i'm trying email output html code too.
if ($_server['request_method'] == 'post'){ $mailto = 'info@website.com'; $mailfrom = isset($_post['email']) ? $_post['email'] : $mailto; $subject = 'email subject'; $message = 'hello, email message...'; // want try '<strong>hello</strong> email message...' $success_url = './success.php'; $error_url = './failed.php'; $error = ''; $autoresponder_from = 'noreply@website.com'; $autoresponder_subject = 'auto response subject'; $autoresponder_message = 'hello john, thank you.'; // want try '<strong>hello john</strong> thank you.'
you need set correct header html emails
have @ example #4: http://www.php.net/manual/en/function.mail.php
php
// send html mail, content-type header must set $headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n";
don't forget add plain copy of message
Comments
Post a Comment