不知道楼主在是unix还是在windows,
在windows下就是直接去extension中
;extension=php_sockets.dll前面的分号应该可以了,当然要确保extension这个路径设置下确在unix下是要自己进行编译的
在windows下就是直接去extension中
;extension=php_sockets.dll前面的分号应该可以了,当然要确保extension这个路径设置下确在unix下是要自己进行编译的
Mailer Error: SMTP Error: Could not connect to SMTP host.
是在$this->smtp->Connect($host, $port, $this->Timeout)未获得正确结果时由该类产生的
而smtp类中有
if(!empty($this->smtp_conn)) {
$sock_status = socket_get_status($this->smtp_conn);
if($sock_status["eof"]) {
# hmm this is an odd situation... the socket is
# valid but we aren't connected anymore
if($this->do_debug >= 1) {
echo "SMTP -> NOTICE:" . $this->CRLF .
"EOF caught while checking if connected";
}
$this->Close();
return false;
}
return true; # everything looks good
}
return false;而$this->smtp_conn是这样赋值的
$this->smtp_conn = fsockopen($host, # the host of the server
$port, # the port to use
$errno, # error number if any
$errstr, # error message if any
$tval); # give up after ? secs******php的socke不能穿过代理,如果你的网站与邮件服务器间有代理,那么请改用其他方法
造成fsockopen失败的原因有$host、$port不对,线路故障,服务器故障等
Warning: fsockopen(): php_hostconnect: connect failed in c:\inetpub\wwwroot\phpmailer\class.smtp.php on line 105Warning: fsockopen(): unable to connect to smtp.21cn.com:25 in c:\inetpub\wwwroot\phpmailer\class.smtp.php on line 105
Message was not sent
Mailer Error: SMTP Error: Could not connect to SMTP host.看样子应该是xuzuning(唠叨)大侠所说的,但我们网站跟21cn.com没有什么代理,那应该怎么解决该问题呢???
Mailer Error: SMTP Error: Could not connect to SMTP host.
简单的英文,不能连接到smtp服务器。21cn发觉你发垃圾邮件了如果随便能发的话,我可以用Fbi邮箱发的啦。
$fp = fsockopen("smtp.21cn.com", 25, &$errno, &$errstr, 60);
if(! $fp)
echo "$errstr ($errno)<br>\n";
else
echo "ok<br>\n";测试一下,看看结果
$fp = fsockopen("smtp.21cn.com", 25, &$errno, &$errstr, 60);
if(! $fp)
echo "$errstr ($errno)<br>\n";
else
echo "ok<br>\n";
///////////////////////////////////////////////////////////////////////////
依然出现了这样的错误:Warning: fsockopen(): php_hostconnect: connect failed in c:\inetpub\wwwroot\phpmailer\test2.php on line 2Warning: fsockopen(): unable to connect to smtp.21cn.com:25 in c:\inetpub\wwwroot\phpmailer\test2.php on line 2
在一个非套接字上尝试了一个操作。 (10038)
/////////////////////////////////////////////////////////////////////////////
请问能不能用WINDOWS自己的smtp,那该怎么用呢?这样会不会被当成为垃圾邮件??
我不懂,请指教?
可以找一个允许发垃圾邮件的服务器 -_-b
或者直接用socket与SMTP服务器通讯
这要求对SMTP协议比较了解
不过网上有不少现成的SMTP类
可以试一下
具体怎么实现,我还正在研究。:)