【发布时间】:2015-05-31 18:54:06
【问题描述】:
我正在使用 phpmailer() 从我的网站发送电子邮件。但是当它发送电子邮件时,我看到以下警告消息。
我不明白它为什么会显示以及如何解决此错误消息。谁能告诉我?
以下是我的代码:
<?php
require_once("mail/PHPMailerAutoload.php");
$mail = new PHPMailer;
$mail->setFrom($email);
$mail->addReplyTo('toemail@gmail.com', 'First Last');
$mail->addAddress('toemail@gmail.com', 'First Last');
$mail->Subject = 'PHPMailer mail() test';
$mail->msgHTML(file_get_contents('mail/contents.html'), dirname(__FILE__));
$mail->AltBody = 'This is a plain-text message body';
$mail->addAttachment('mail/images/phpmailer_mini.png');
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
【问题讨论】:
-
我可以复制你的代码并粘贴它作为我自己的使用它谷歌如何知道谁发送了电子邮件?使用 SMTP。