我正在尝试在 jobbersbase 的 phpmailer() 中添加文件。
但我不知道如何正确添加它
我是这样使用的,但它只发送 $mailer->Body = ($data['apply_location1']);,我的意思是在 $mailer->AltBody = $msg; 上方的那个 陈述。但我想通过邮件发送所有信息。
public function MailApplyOnline($data)
{
$mailer = $this->getConfiguredMailer();
$subject = $this->emailTranslator->GetApplyOnlineSubject($data);
$msg = $data['apply_msg'];
$msg .= $this->emailTranslator->GetApplyOnlineMsg($_SERVER['HTTP_REFERER']);
$mailer->SetFrom($data['apply_email'], $data['apply_name']);
$mailer->AddAddress($data['company_email'], $data['company_name']);
$mailer->Subject = $subject;
$mailer->Body = $this->nl2br($msg);
$mailer->Body = ($data['apply_company']);
$mailer->Body = ($data['apply_contact']);
$mailer->Body = ($data['apply_title']);
$mailer->Body = ($data['apply_location']);
$mailer->Body = ($data['apply_location1']);
$mailer->AltBody = $msg;
if ($data['attachment_filename'] != '')
{
$mailer->AddAttachment($data['attachment_path'], $data['attachment_filename']);
}
if ($mailer->Send())
{
return true;
}
else
{
return false;
}
}