5
Avoid spam points - Message only has text/html MIME parts
rated 5 times
[
5]
[
0]
/ comments: 0 / hits: 1632
/ 2 years ago, tue, nov 14, 2017, 04:52:05
<?php
$subject = 'Mail Subject';
$uid = uniqid('np');
$header = "MIME-Version: 1.0\r\n";
$header .= "From: My Website Name <noreply@mywebsitename.com>"."\r\n";
$header .= "Organization: My Company Name \r\n";
$header .= "Content-Type: multipart/alternative;boundary=" . $uid . "\r\n";
$body = "This is a MIME encoded message.";
$body .= "\r\n\r\n--" . $uid . "\r\n";
$body .= "Content-type: text/plain;charset=utf-8\r\n\r\n";
$body .= "Test Message\n\nMy test message\n\n";
$body .= "\r\n\r\n--" . $uid . "\r\n";
$body .= "Content-type: text/html;charset=utf-8\r\n\r\n";
$body .= "<html><body><h1>Test Message</h1>My test message<br /></body></html>";
$body .= "\r\n\r\n--" . $uid . "--";
mail('admin@example.com',$subject,$body,$header);
?>
More From
» PHP