<?php
//发件人
$from = " [email]ywm@xxxx.net[/email]";
//收件人
$email= " [email]xxxx@xxxxx.net[/email]";
//邮件主题 注:防止中文乱码
$subject = "=?UTF-8?B?".base64_encode('公司邮件系统')."?=";
//HTML格式页面
$p_w_upload= "test.html";
//发件人
$from = " [email]ywm@xxxx.net[/email]";
//收件人
$email= " [email]xxxx@xxxxx.net[/email]";
//邮件主题 注:防止中文乱码
$subject = "=?UTF-8?B?".base64_encode('公司邮件系统')."?=";
//HTML格式页面
$p_w_upload= "test.html";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
// Additional headers
$headers .= 'To: Mary < [email]mary@example.com[/email]>, Kelly < '">[email]kelly@example.com[/email]>' . "\r\n";
$headers .= 'From: Birthday Reminder < '">[email]birthday@example.com[/email]>' . "\r\n";
$headers .= 'To: Mary < [email]mary@example.com[/email]>, Kelly < '">[email]kelly@example.com[/email]>' . "\r\n";
$headers .= 'From: Birthday Reminder < '">[email]birthday@example.com[/email]>' . "\r\n";
//打开HTML文件
$body = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
//发送MAIL
if(mail($email, $subject, $body, $headers))
echo "success!!!";
?>
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
//发送MAIL
if(mail($email, $subject, $body, $headers))
echo "success!!!";
?>
转载于:https://blog.51cto.com/phpbk/113864