<?php
/* recipients */
$to = "[email protected]" . ", " ; // note the comma
$to .= "[email protected]";/* subject */
$subject = "Birthday Reminders for August";/* message */
$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>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>
';/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";/* additional headers */
$headers .= "To: Mary <[email protected]>, Kelly <[email protected]>\r\n";
$headers .= "From: Birthday Reminder <[email protected]>\r\n";
$headers .= "Cc: [email protected]\r\n";
$headers .= "Bcc: [email protected]\r\n";/* and now mail it */
mail($to, $subject, $message, $headers);
?>
/* recipients */
$to = "[email protected]" . ", " ; // note the comma
$to .= "[email protected]";/* subject */
$subject = "Birthday Reminders for August";/* message */
$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>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>
';/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";/* additional headers */
$headers .= "To: Mary <[email protected]>, Kelly <[email protected]>\r\n";
$headers .= "From: Birthday Reminder <[email protected]>\r\n";
$headers .= "Cc: [email protected]\r\n";
$headers .= "Bcc: [email protected]\r\n";/* and now mail it */
mail($to, $subject, $message, $headers);
?>
解决方案 »
- PDO连接数据库从SQLITE改为MYSQL的问题
- vbulletin 搜索功能是哪个文件?
- 用pngencoder + php 如何保存图片
- php 怎么读取zip内容
- 用phpmailer发送邮件不成功
- php取得最小值的一条数据
- 问一下<input type="file"> 控件,能不能让输入框和按钮分两行显示,还有能不能让按钮在左边,输入框在右边
- PHP网站出错在哪里?
- php里的javascript 问题在线等待___________________________
- 高分求解:在该情况下,新闻采用动态还是静态页面???(关于性能分析)
- 为什么PHP要引入可变变量的概念? (形如$$a这样的形式)
- 用PHP+MySQL开发一个有订单管理的商务网,需要使用模板技术吗?
$to .= "[email protected]";这个是一个,在ASP里相当于to="aaaaaa"
to=to&"bbbbb"你到一个支持发送邮件的服务器上试一下就OK了
也类于其它语言中的+连接一样的。邮件发送的例子,我建议你多参考一下帮助,帮助里面有很多这种例子。
$subject = "产品发布会在线报名";
$body = "";
$body .= "公司名称:".$_POST["company"]."\r\n";
$body .= "姓 名:".$_POST["name"]."\r\n";
$body .= "职 务:".$_POST["postion"]."\r\n";
$body .= "联系方式:".$_POST["connection"]."\r\n";
$serverMail = "210.71.26.5"; //邮件服务器地址
$mailTo = "[email protected]"; //发送目的地址
$mailFrom = "[email protected]"; //发送源邮箱
$serverPassword = "test"; //邮箱密码
$jmail = new COM("JMAIL.Message"); //建立发送邮件的对象
//$jMail->Encoding="base64";
$jmail->ContentTransferEncoding="base64";
$jmail->Charset = "GB2312"; //邮件的文字编码为国标<br>
$jmail->ContentType="text/text"; //邮件的格式为HTML格式
$jmail->AddRecipient($mailTo); //邮件收件人的地址
$jmail->From = $mailFrom; //发件人的E-MAIL地址
$jmail->FromName=$_POST["name"];//发件人姓名
$jmail->MailServerUserName = $mailFrom; //登录邮件服务器所需的用户名
$jmail->MailServerPassword = $serverPassword; //登录邮件服务器所需的密码
$jmail->Subject = $subject; //邮件的标题
$jmail->Body = $body; //邮件的内容
$jmail->Priority = 3; //邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值
$jmail->Send($serverMail); //执行邮件发送(通过邮件服务器地址)
$jmail->Close(); //关闭对象
echo "<script>alert('您的信息已经发送,我们将尽快与您联系!');window.close();</script>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";mail("[email protected]","标题","内容", $headers);