我很想弄清楚这一点。主要问题是,当我使用 php mailer 循环向我们的用户发送电子邮件时,它只会发送给一些用户,我认为这是一个 DNS 问题。
这是邮件代码
function massEmail($from,$subject,$to,$body) {
require_once('packages/class.phpmailer.php');
$success = 0;
foreach($to as $person) {
usleep(2000);
$mail = new PHPMailer();
$mail->From = $from;
$mail->IsHTML(true);
$mail->FromName = "cmiVFX";
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AddAddress($person);
$ret = $mail->Send();
if($ret) {
$success++;
}
}
var_dump($success);
}
运行主机名时,我得到了这个
server.cmivfx.com
当运行 hostname -f 或 --fqdn 我得到
hostname: Name or service not known
重新启动 sendmail 时我得到
hostname: Name or service not known
这是我的主机文件
127.0.0.1 localhost.localdomain localhost
127.0.1.1 server.cmivfx.com cmivfx.com
69.162.76.226 server.cmivfx.com cmivfx.com
我的主机名文件是
server.cmivfx.com
我的邮件服务器指向谷歌应用程序所以挖掘 cmivfx.com 任何给我
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11895
;; flags: qr rd ra; QUERY: 1, ANSWER: 9, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;cmivfx.com. IN ANY
;; ANSWER SECTION:
cmivfx.com. 1553 IN SOA ns1.limestonenetworks.com. noc.limestonenetworks.com. 1344528611 16384 2048 1048576 2560
cmivfx.com. 1553 IN NS ns1.limestonenetworks.com.
cmivfx.com. 1553 IN NS ns2.limestonenetworks.com.
cmivfx.com. 1544 IN MX 1 ASPMX.L.GOOGLE.com.
cmivfx.com. 1544 IN MX 5 ALT1.ASPMX.L.GOOGLE.com.
cmivfx.com. 1544 IN MX 10 ASPMX2.GOOGLEMAIL.com.
cmivfx.com. 1544 IN MX 10 ASPMX3.GOOGLEMAIL.com.
cmivfx.com. 1544 IN MX 5 ALT2.ASPMX.L.GOOGLE.com.
cmivfx.com. 1519 IN A 69.162.76.226
;; Query time: 0 msec
;; SERVER: 208.115.254.242#53(208.115.254.242)
;; WHEN: Thu Aug 9 11:48:14 2012
;; MSG SIZE rcvd: 268
最后,当我用我的 gmail 运行邮件 php 代码时,它很好。和其他一些人我得到
Could not instantiate mail function
希望我已经提供了足够的信息,以便了解 sendmail 的人可以帮助我。非常感谢!