绠€鍗曠殑javamail鍙戦偖浠舵€庝箞涓嶈鍛€锛熷府鎴戠湅鐪嬶紝鍝噷鏈夐敊璇?/a>

时间:2021-03-27 19:00:00
<%@ page contentType="text/html; charset=GBK" import="javax.mail.*,javax.mail.event.*,javax.mail.internet.*,java.util.*" %>
<%
Properties props = new Properties();
props.put("mail.smtp.host","smtp.mail.yahoo.com");
Session s = Session.getInstance(props);
MimeMessage message = new MimeMessage(s);

InternetAddress from  = new InternetAddress("xiao_xiao112@163.com");
message.setFrom(from);
InternetAddress to = new InternetAddress("zhang_xiao_tian@sohu.com");
message.addRecipient(Message.RecipientType.TO,to);

message.setSubject("Test from JavaMail.");
message.setText("Hello from JavaMail!");

Store store = s.getStore("pop3");
store.connect("pop.mail.163.com","xiao_xiao112","aaaa");
Transport.send(message);
store.close();
%>
<html>
<head>
<title>
testjavamail
</title>
</head>
<body bgcolor="#ffffff">
<p>test javamail</p>
</body>
</html>


鎻愮ず閿欒淇℃伅锛?

   javax.mail.MessagingException: Connect failed;
  nested exception is:
java.net.UnknownHostException: pop.mail.163.com
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:106)
at javax.mail.Service.connect(Service.java:233)
at javax.mail.Service.connect(Service.java:134)
at _mail1__jsp._jspService(/mail1.jsp:2)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.pageservice(Page.java:549)
at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:184)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:149)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:257)
at com.caucho.server.port.WorkerThread.run(WorkerThread.java:123)
at java.lang.Thread.run(Thread.java:536)

鍏充簬閭鐢ㄦ埛鍚嶅瘑鐮佷粈涔堢殑鏄病闂鐨?

7 涓В鍐虫柟妗?/h2>

#1


up

#2


閭欢鏈嶅姟鍣ㄥ湴鍧€鍐欓敊浜?

pop.163.com

http://www.javayou.com/showlog.jspe?cat_id=3&log_id=372

#3


http://www.javayou.com/showlog.jspe?cat_id=3&log_id=136

#4



鏀瑰悗鍑鸿繖鏍风殑閿欒锛?


javax.mail.SendFailedException: Sending failed;
  nested exception is:
class javax.mail.MessagingException: 530 authentication required - for help go to http://help.yahoo.com/help/us/mail/pop/pop-11.html

at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at _mail1__jsp._jspService(/mail1.jsp:2)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.pageservice(Page.java:549)
at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:184)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:149)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:257)
at com.caucho.server.port.WorkerThread.run(WorkerThread.java:123)
at java.lang.Thread.run(Thread.java:536)


鎬庝箞鍔?

#5


杩欐槸鍥犱负浣犵殑閭鏈嶅姟鍣ㄩ渶瑕侀獙璇佺敤鎴疯韩浠斤紝浣犺繕鏄湅鐪嬫垜缁欎綘鐨勯摼鎺ュ惂锛?

#6


鎶婁富鏈哄湴鍧€鏀逛负 pop.163.com

#7


濡傛灉瑕侀獙璇佺敤鎴疯韩浠界▼搴忚嚜鍔ㄤ細璺冲嚭瀵硅瘽妗嗙殑锛屾垜浠ュ墠鍋氱殑鏃跺€欏氨鏄繖鏍风殑銆傜幇鍦ㄥ浗鍐呬竴鑸殑閭欢鎻愪緵鍟嗛兘涓嶆敮鎸佽繖绉嶅姛鑳界殑锛屽ソ璞ahoo鏄彲浠ョ殑锛屼絾瑕佹敹璐圭殑銆?

#1


up

#2


閭欢鏈嶅姟鍣ㄥ湴鍧€鍐欓敊浜?

pop.163.com

http://www.javayou.com/showlog.jspe?cat_id=3&log_id=372

#3


http://www.javayou.com/showlog.jspe?cat_id=3&log_id=136

#4



鏀瑰悗鍑鸿繖鏍风殑閿欒锛?


javax.mail.SendFailedException: Sending failed;
  nested exception is:
class javax.mail.MessagingException: 530 authentication required - for help go to http://help.yahoo.com/help/us/mail/pop/pop-11.html

at javax.mail.Transport.send0(Transport.java:218)
at javax.mail.Transport.send(Transport.java:80)
at _mail1__jsp._jspService(/mail1.jsp:2)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.pageservice(Page.java:549)
at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:184)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:149)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:257)
at com.caucho.server.port.WorkerThread.run(WorkerThread.java:123)
at java.lang.Thread.run(Thread.java:536)


鎬庝箞鍔?

#5


杩欐槸鍥犱负浣犵殑閭鏈嶅姟鍣ㄩ渶瑕侀獙璇佺敤鎴疯韩浠斤紝浣犺繕鏄湅鐪嬫垜缁欎綘鐨勯摼鎺ュ惂锛?

#6


鎶婁富鏈哄湴鍧€鏀逛负 pop.163.com

#7


濡傛灉瑕侀獙璇佺敤鎴疯韩浠界▼搴忚嚜鍔ㄤ細璺冲嚭瀵硅瘽妗嗙殑锛屾垜浠ュ墠鍋氱殑鏃跺€欏氨鏄繖鏍风殑銆傜幇鍦ㄥ浗鍐呬竴鑸殑閭欢鎻愪緵鍟嗛兘涓嶆敮鎸佽繖绉嶅姛鑳界殑锛屽ソ璞ahoo鏄彲浠ョ殑锛屼絾瑕佹敹璐圭殑銆?