Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有很多电子邮件、gmail 和其他电子邮件,我尝试向每个电子邮件发送一封电子邮件。实际上,只有 1 封电子邮件收到该消息,而另一封电子邮件,例如 gmail,则没有。
使用 linux :该命令echo "Hi" | mail -s "test" xxxxxxxx@gmail.com工作正常。
echo "Hi" | mail -s "test" xxxxxxxx@gmail.com
但是使用 PHP,邮件不会发送....
我的 mail.log 中没有错误。你有什么想法吗?
谢谢 !
编辑:我在 linux 服务器上。
尝试这样的事情:
$mail = new PHPMailer(); // defaults to using php "mail()" $body = $mailBody; $mail->SetFrom('xxxxxxxx@example.com'); $mail->AddAddress('yyyyy@example.com', 'Your Name'); $mail->Subject = 'The subject'; $mail->MsgHTML('The body'); $mail->Send();