一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

php 利用phpmailer 在线发送邮件

时间:2022-07-02 10:31:11 编辑:袖梨 来源:一聚教程网

html代码



















邮箱:
电话:
内容:


去down.111cn下载一个phpmailer

require("mail/class.phpmailer.php");

$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp.163.com"; // smtp1.example.com;smtp2.example.comspecify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "mailangel123"; // SMTP username
$mail->Password = "*******"; // SMTP password


$mail->From = "";
$mail->FromName = "人才自荐";
$Subject =PostGet('tel',1);
$jmail =PostGet('mail',1);
$body =PostGet('bodys',1);
$array ;

$mail->AddReplyTo("", "此邮箱无需回复!");
$mail->AddAddress($array,'您好!');
$mail->Wrap = 50;
$mail->CharSet="GB2312"; // set word wrap to 50 characters
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
$mail->IsHTML(true); // set email format to HTML

$mail->Subject = $Subject;
$mail->Body = $body.'
'.$jmail;
//$mail->AltBody = "This is the body in plain text for non-HTML mail clients";

if(!$mail->Send())
{
echo "Message could not be sent.

";
echo "Mailer Error: " . $mail->ErrorInfo;
$mail->ClearAddresses();
$mail->ClearAttachments();

}
else
{
echo "您好,你的信息己经发送到我们负责人信箱,请等候佳声。:window.close();">点击

关闭";
}



/* echo ""; */

?>
// 本站原创转载注明来源

热门栏目