건초 PHPMailer를 사용하여 간단한 전자 메일을 보내고 있지만 SetFrom() 함수가 작동하지 않는 것 같습니다. 바로 phpmails 워드 프로세서 (http://phpmailer.worxware.com/index.php?pg=examplebmail)PHPMailer가 정의되지 않은 메서드 호출로 오류 발생 PHPMailer :: SetFrom()
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('[email protected]', 'tell a friend');
$mail->AddAddress($to_email, $to);
$mail->Subject = "tell a friend";
$mail->MsgHTML($body);
$mail->Send();
어떤 아이디어에서입니까?
EDIT
주위 PHPMailer의 다수의 버전이, phpmailer 내 버전에 존재 나던 SetFrom() 함수 제가
$mail->From = '';
$mail->FromName = '';
SetFrom()이 존재하지 않습니다 (오류 상태로) 그러나 $ mail-> From = 'x';를 사용하여 $ From 및 $ FromName 변수를 설정할 수 있습니다. – dotty
@dotty 아마도 PHPMailer의 다른 (구형) 버전을 사용하고있을 것입니다. –