Send HTML email
Posted in PHP, on January 27, 2012 at 06:52
function email_send($email, $subject, $message) {
$from = 'test@test.com';
$to = $email;
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8'. "\r\n";
$headers .= 'To: '.$to."\r\n";
$headers .= 'From: '.$from."\r\n";
$headers .= 'Reply-To: '.$from."\r\n";
$message = '<html><body>'.$message.'</body></html>';
if (mail($to, $subject, $message, $headers))
return true;
else
return false;
}
Share this code
Use the link below to share the code:
http://www.codesend.com/view/8cb1090a21c90e5dd5045aa7c6b698c9/
HTML
<a href="http://www.codesend.com/view/8cb1090a21c90e5dd5045aa7c6b698c9/">Send HTML email</a>
BBCode
[url=http://www.codesend.com/view/8cb1090a21c90e5dd5045aa7c6b698c9/]Send HTML email[/url]
© 2010 CodeSend.com - send code quick and easy
Syntax highlighting by Alex Gorbatchev
Syntax highlighting by Alex Gorbatchev
