最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 使用qmail发送邮件实现代码
时间:2022-06-24 22:07:03 编辑:袖梨 来源:一聚教程网
function send_check_mail($email, $subject,$uid,$buffer)
{
echo "hello";
$command = "/var/qmail/bin/qmail-inject ".$email; //qmail程序地址,$email是要发送的地址
$handle = popen($command, "w"); //打开管道
if (!$handle) {
return false;
}$from = "yangxuemei2012@111com.net"; //发件人
fwrite($handle, "from: ".$from."n"); //往管道写数据
fwrite($handle, "return-path: ".$from."n");
fwrite($handle, "to: ".$uid."n");
fwrite($handle, "subject: ".$subject."n");
fwrite($handle, "mime-version: 1.0n");
fwrite($handle, "content-type: text/html; charset="gb2312"nn");
fwrite($handle, $buffer."n");
pclose($handle); //关闭管道return true;
}
$subject = "测试邮件";$uid = $_post['uid']; //from信息
".$u_email
$content= "." 您好!
谢谢,www.111com.net!
"; //内容信息$u_email = "machunjie2003@111com.net"; //发送到的邮箱
if (send_check_mail($u_email, $subject, $uid, $content)) {echo "恭喜!发送投票邮件到您的邮箱!
请检查您的邮箱:".$u_email."
". $close;
} else {echo "很不幸,发送投票邮件到您的邮箱失败,请重试或者联系开发人员。
". $close;}
相关文章
- 恶意不息弓箭轮椅流怎么玩 04-25
- 原神4.6新增须弥宝箱点位一览 04-25
- 恶意不息无名山口隐藏地图怎么进入 04-25
- 原神4.6周本BOSS仆人相关成就攻略 04-25
- 原神迟来的归乡任务怎么做 04-25
- 《塞尔达传说王国之泪》恶魔神像在哪? 恶魔神像位置 04-25