我在使用PHPMailer时遇到问题。我正在为公司的求职申请创建一个页面。有一份表格,申请人填写,表格数据发送给人力资源部。然后,必须有服务器对申请人的自动响应,这要感谢应用程序。发送给HR的第一封电子邮件,但第二封未发送。代码是:
$mailer = new PHPMailer();
$mailer->From = "[email protected]";
$mailer->FromName = "Báv gyakornoki jelentkezés";
$mailer->AddAddress("[email protected]", "the subject");
$mailer->isHTML(true);
$mailer->CharSet = 'UTF-8';
$mailer->Subject = "Báv gyakornoki regisztráció";
$body = "The body with the form data to HR";
$mailer->Body = $body;
$mailer->AddAttachment($cv_path, $_FILES['cv']['name']);
$mailer->AddAttachment($motivation_letter_path, $_FILES['motivation']['name']);
$success = $mailer->send();
//this email gets sent
$autoresponse = new PHPMailer();
$autoresponse->From = "[email protected]";
$autoresponse->CharSet = "UTF-8";
$autoresponse->AddAddress($email);
$autoresponse->Subject = "This is an automatic message, please don't answer it";
$body = "This is the automatic response to the applicant";
$autoresponse->body = $body;
$autoresponse_sent = $autoresponse->send();
//this email won't get sent
改变
$autoresponse->body = $body;
至
$autoresponse->Body = $body;
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句