【发布时间】:2015-12-29 04:53:00
【问题描述】:
我正在使用 phpmailer 并尝试发送带有附件的电子邮件,但电子邮件不起作用(不发送电子邮件)以及附件。
require_once 'phpmailer/class.phpmailer.php';
if (isset($_REQUEST['FindDealer'])) {
$mail->AddAddress('whoto@otherdomain.com', 'John Doe');
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddReplyTo('name@yourdomain.com', 'First Last');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mail->AltBody = 'To view the message,
$mail->MsgHTML(file_get_contents('contents . html'));
$email->AddAttachment( $file_to_attach , 'pdf . pdf);
return $email->Send();
exit;
}
请指导我这个..
【问题讨论】:
-
看颜色编码,能看出区别吗?您在
$mail->AltBody =行缺少'; -
@Epodax thx 亲爱的 ...