7
Avoid spam points - Message only has text/html MIME parts
<?php
$subject = 'Mail Subject';
$uid = uniqid('np');
$header = "MIME-Version: 1.0\r\n";
$header .= "From: My Website Name <[email protected]>"."\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('[email protected]',$subject,$body,$header);
?>
rated 7 times
(7)
(0)
comments: 0 / hits: 3123
/ 3 years ago, tue, nov 14, 17, 04:52:05
More From
» PHP
Comments
There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account