当前位置: 技术问答>java相关
javamail的问题??
来源: 互联网 发布时间:2017-04-29
本文导语: 我复制了一段代码: JSP meets JavaMail, what a sweet combo. Your mail has been sent. 可是运行了一下。出现下列错误: javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.MessagingExce...
我复制了一段代码:
JSP meets JavaMail, what a sweet combo.
可是运行了一下。出现下列错误:
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Unknown SMTP host: smtp.jspinsider.com;
nested exception is:
java.net.UnknownHostException: smtp.jspinsider.com
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at _sendmail0__jsp._jspService(/sendmail0.jsp:28)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.subservice(Page.java:485)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
at com.caucho.server.http.Invocation.service(Invocation.java:312)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:221)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java, Compiled Code)
at com.caucho.server.TcpConnection.run(TcpConnection.java, Compiled Code)
at java.lang.Thread.run(Thread.java:479)
请各位帮帮忙忙。
JSP meets JavaMail, what a sweet combo.
Your mail has been sent.
可是运行了一下。出现下列错误:
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Unknown SMTP host: smtp.jspinsider.com;
nested exception is:
java.net.UnknownHostException: smtp.jspinsider.com
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
at _sendmail0__jsp._jspService(/sendmail0.jsp:28)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.subservice(Page.java:485)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
at com.caucho.server.http.Invocation.service(Invocation.java:312)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:221)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java, Compiled Code)
at com.caucho.server.TcpConnection.run(TcpConnection.java, Compiled Code)
at java.lang.Thread.run(Thread.java:479)
请各位帮帮忙忙。
|
props.put("mail.smtp.host", "smtp.jspinsider.com");
你用的是263的邮箱,应该用263的smtp服务器
并且还有一个问题,是关于smtp认证的问题,你这里也没有
详细实现细节请看这里
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=12942
如有问题清发短消息
你用的是263的邮箱,应该用263的smtp服务器
并且还有一个问题,是关于smtp认证的问题,你这里也没有
详细实现细节请看这里
http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=12942
如有问题清发短消息
|
props.put("mail.smtp.host", "smtp.263.net");
props.put("mail.smtp.auth", "true"); //add
props.put("mail.smtp.auth", "true"); //add
|
也许你应该先看看这边文章再说:
http://www.chinabs.net/jsp/default.asp?infoid=13
他可以解决你实现发送邮件的问题,如果现在进一步了解的话,那他就远远不够了!
http://www.chinabs.net/jsp/default.asp?infoid=13
他可以解决你实现发送邮件的问题,如果现在进一步了解的话,那他就远远不够了!