天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

解決163/sohu/sina不能夠收到PHP MAIL函數(shù)發(fā)出郵件的問題

復(fù)制代碼 代碼如下:
// multiple recipients
$to = 'aidan@example.com' . ', '; // note the comma
$to .= 'wez@example.com';
// 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, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "/r/n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "/r/n";
// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "/r/n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "/r/n";
$headers .= 'Cc: birthdayarchive@example.com' . "/r/n";
$headers .= 'Bcc: birthdaycheck@example.com' . "/r/n";
// Mail it
mail($to, $subject, $message, $headers);

查看sendmail的maillog,發(fā)現(xiàn)奇怪的內(nèi)容。
復(fù)制代碼 代碼如下:
Mar 1 11:28:03 <a title="shaohui" target="_blank">shaohui</a>.org sendmail[27526]: n213S1Xc027524: to=<shaohui_1983@163.com>, ctladdr=<shaohui@shaohui.org> (500/500), delay=00:00:02, xdelay=00:00:01, mailer=esmtp, pri=150812, relay=163mx03.mxmail.NETease.com. [220.181.12.72], dsn=5.0.0, stat=Service unavailable

但是,如果我使用Linux Shell 的mail命令是可以發(fā)送成功的,不過多加了一條-f 參數(shù)偽造發(fā)件人。這是唯一的不同,于是maillog 的其中一個字段ctladdr顯示也不一樣。不再是apache用戶,我懷疑163等國內(nèi)的郵件服務(wù)提供商,把所有的apache的用戶的郵件當(dāng)成垃圾郵件處理掉了。
復(fù)制代碼 代碼如下:
Feb 25 23:44:59 <a title="shaohui" target="_blank">shaohui</a> sendmail[13067]: n1PFixH4013067: to=shaohui_1983@163.com, ctladdr=contact@shaohui.org (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30869, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n1PFixdx013068 Message accepted for delivery)

根源找到,于是問題就很好解決了,查一下php的手冊,發(fā)現(xiàn)mail函數(shù)原來也是可以偽造發(fā)件人的。
復(fù)制代碼 代碼如下:
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

在第六個參數(shù)additional_parameters使用額外的參數(shù)"-f sender_addr@mydomain.com", 問題就解決了。

php技術(shù)解決163/sohu/sina不能夠收到PHP MAIL函數(shù)發(fā)出郵件的問題,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 亚洲日韩天堂在线中文字幕 | 欧美高清视频www夜色资源网 | 最新高清无码专区 | 国产系列视频二区 | AV色蜜桃一区二区三区 | 青青久| 亚洲精品无码AV中文字幕蜜桃 | 天天射天天爱天天干 | 少妇伦子伦情品无吗 | xxx动漫xxx在线观看 | 理论片午午伦夜理片久久 | 国产在线视频在线观看 | 亚洲欧美韩国综合色 | 恋夜秀场支持安卓版全部视频国产 | 亚洲高清国产拍精品动图 | 国产乱码免费卡1卡二卡3卡四卡 | 6 10young俄罗斯 | 成片在线看一区二区草莓 | 亚洲 国产 日韩 欧美 在线 | 中字幕视频在线永久在线 | 啊灬啊别停灬用力啊在线观看视频 | 日本久久高清视频 | 亚洲日韩欧美国产中文在线 | 99热久久这里只有精品视频 | 国产成人综合在线观看 | 亚洲精品AV中文字幕在线 | 看免费人成va视频全 | 挺进老师的紧窄小肉六电影完整版 | 亚洲免费国产 | 毛片无码免费无码播放 | 91九色网址 | 肉多的小说腐小说 | 97视频免费观看 | 操老太太的逼 | 国产亚洲精品久久777777 | 99精品久久| 国产人人为我我为人人澡 | 99国产在线视频有精品视频 | 7723日本高清完整版在线观看 | 九九精品视频一区二区三区 | 国产精品九九久久精品视 |