嗨,当我尝试发送电子邮件时收到此错误
SMTP -> ERROR: MAIL not accepted from server: 501 : sender address must contain a domain
它曾经工作正常我不确定我使用 php mailer 发生了什么,但我认为这并不重要
$smtp = setting::get_smtp( 1 , 'support');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = $smtp->address; //localhost
$mail->CharSet = "utf-8";
$mail->SMTPAuth = true;
$mail->Port = $smtp->port; // 25
$mail->Username = $smtp->username;
$mail->Password = $smtp->password;
$mail->From = $smtp->from ; // www.mysite.com
$mail->AddReplyTo ($smtp->username , $smtp->from ); // noreply@mysite.com //www.mysite.com
$mail->Subject = $title;
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->MsgHTML($msg);
$mail->SMTPDebug = 1;
if( filter_var( $admin_email , FILTER_VALIDATE_EMAIL ) == TRUE ){
$mail->AddAddress($admin_email , "John Doe");
$mail->Send();
}