unknown.bundle.rar SMTP host: ?

发送邮件SMTP Error Could not connect to SMTP host. send fail的解决办法
(1)服务器不能使用smtp的形式发送邮件
解决办法:很多网站列出的解决办法说是因为smtp大小写的问题,虽然问题的本质不在这里,但确实也需要改这个地方,至于为什么,看下面的操作。
在 class.phpmailer.php 中,将:
function IsSMTP(){$this-&Mailer='smtp';}
function IsSMTP(){$this-&Mailer = 'SMTP';}
这个地方的修改不是使用了smtp来发送邮件,而是使用了另外一种方式发送邮件,检查 class.phpmailer.php 文件里面有下面这么一段:
switch($this-&Mailer){
case 'sendmail':
return $this-&SendmailSend($header, $body);
case 'smtp'://由于SMTP和smtp不相等 所以选择的是下面MailSend发送邮件 并不是使用smtp发送邮件
return $this-&SmtpSend($header, $body);
return $this-&MailSend($header, $body);
(2)Linux主机禁用了fsockopen()函数
国内有很多空间服务商出于安全考虑会禁用服务器的fsockopen函数。
解决方法:
用pfsockopen() 函数代替 fsockopen() ,如果 pfsockopen 函数也被禁用的话,还可换其他可以操作Socket函数来代替, 如stream_socket_client()
在 class.smtp.php 中将 @fsockopen 改成 @pfsockopen
$this-&smtp_conn = @fsockopen($host,
// the host of the server
// the port to use
// error number if any
// error message if any
// give up after ? secs
$this-&smtp_conn = @pfsockopen($host,
// the host of the server
// the port to use
// error number if any
// error message if any
// give up after ? secs
(3)防火墙安全设置规则,如果以上两种方案都不凑效,那估计是防火墙的规则问题了,可以让服务器管理员去掉所有的防火墙规则,然后测试一下,看是否是这个原因。您可能感兴趣的文章转载请注明出处:本文永久地址:文章来源:-わ千与千寻上一篇:下一篇:热门文章随机文章java - Unknown SMTP host - Stack Overflow
to customize your list.
Announcing Stack Overflow Documentation
We started with Q&A. Technical documentation is next, and we need your help.
Whether you're a beginner or an experienced developer, you can contribute.
I am running a Java web application using tomcat to send generated reports via emails to the users.
I am able to send the emails but after few hours the server stops sending emails, with the following error.
javax.mail.MessagingException: Unknown SMTP host: mail.mydomain.co.
nested exception is:
java.net.UnknownHostException: mail.mydomain.co.uk
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1970)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:642)
at javax.mail.Service.connect(Service.java:317)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at com.turnkey.email.SendEmail.sendMail(SendEmail.java:119)
at com.municationThread.run(CommunicationThread.java:399)
Caused by: java.net.UnknownHostException: mail.mydomain.co.uk
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:233)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1938)
... 8 more
After some time the server starts sending emails again.
Can anyone tell me what could be the problem.
And how do I solve this problem?
This looks like a failure in your name service.
The JDK isn't able to look up the host name to find its internet address.
Since this works sometimes and not others, it looks like an intermittent failure of the name service.
The name service failure could be due to some failure in your local operating system, or it could be due to some network failure communicating with your DNS server or other name service server, or it could be a failure in that DNS server or name service server itself.
Determining the exact cause of the failure will require some debugging.
Note that the JDK caches the results of name server lookups for some time so you'll need to factor that into your debugging.
Also make sure there is no space at the end of smtp hostname eg. SPACEHERE
. Surprisingly this happened to me and finally after removing this space there was no complain about smtp host . Email was successfully sent
Set for host the ip address of the domain name instead of the domain name.
use nslookup mail.mydomain.co.uk on cmd to find the ip address.
It worked for me.
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
The week's top questions and answers
Important community announcements
Questions that need answers
By subscribing, you agree to the
Stack Overflow works best with JavaScript enabledjavax.mail.MessagingException:Unknown&SMTP&host:
javax.mail.MessagingException: Unknown SMTP host:
上述异常的出现是应为发送邮件的服务器不能上网连接不上 "" 服务器导致!
不能上网怎么去访问邮件服务器?
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

我要回帖

更多关于 unknown.bundle.rar 的文章

 

随机推荐