嗨,我正在使用PHPMailer发送一些简单的电子邮件,但是SetFrom()函数似乎不起作用,即使我使用的代码直接来自phpmails文档(http://phpmailer.worxware.com/index.php?pg=examplebmail)
这是我的错误信息:
Call to undefined method PHPMailer::SetFrom()
以及我的脚本
require_once('inc/phpmailer/class.phpmailer.php');
$mail = new PHPMailer(); // defaults to using php "mail()"
$body = $message;
$mail->SetFrom('tell-a-friend@domain.com', 'tell a friend');
$mail->AddAddress($to_email, $to);
$mail->Subject = "tell a friend";
$mail->MsgHTML($body);
$mail->Send();
您好,以下是您需要翻译的内容:
有什么想法吗?
编辑
事实证明,在我的phpmailer版本中不存在SetFrom()函数,我可以使用以下方式设置这些值
$mail->From = '';
$mail->FromName = '';