与MySQL联系表格发送电子邮件时填写表格
答
//多个收件人
$to = '[email protected], [email protected]'; // note the comma
//主题
$subject = 'Birthday Reminders for August';
//消息
$message = '
<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>Johny</td><td>10th</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>
';
//要发送HTML邮件时,Content-type头必须设置
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=iso-8859-1';
//附加头
$headers[] = 'To: Mary <[email protected]>, Kelly <[email protected]>';
$headers[] = 'From: Birthday Reminder <[email protected]>';
$headers[] = 'Cc: [email protected]';
$headers[] = 'Bcc: [email protected]';
//邮寄
mail($to, $subject, $message, implode("\r\n", $headers));
欢迎来到Stackoverflow!为了获得有用的答案,请包括您迄今尝试解决此问题的代码,以便我们帮助您调试或改进它。这就是工作原理。 – ITWitch
有太多可能的答案,或者这个格式的答案太长。请添加详细信息以缩小答案集或隔离可以用几个段落回答的问题。我建议你找一个开发论坛(也许[Quora](http://www.quora.com/Computer-Programming?))来解决一般问题。然后,如果您有特定的编码问题,请回到Stack Overflow,我们很乐意提供帮助。 –