JavaMail 问题--未解决

Exception in thread "main" org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Exception reading response (java.net.SocketTimeoutException: Read timed out)
	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:419)
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:342)
	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:338)
	at com.test.blog.simplemail.mailtest.sendEmail(mailtest.java:66)
	at com.test.blog.simplemail.mailtest.main(mailtest.java:22)
Caused by: javax.mail.MessagingException: Exception reading response (java.net.SocketTimeoutException: Read timed out)
	at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1611)
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1369)
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
	at javax.mail.Service.connect(Service.java:248)
	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
	... 4 more
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:129)
	at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
	at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:753)
	at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
	at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:110)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
	at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:88)
	at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1589)
	... 8 more

还以为是因为浏览器打开了邮箱,不过关掉浏览器的窗口还是出现这个情况,本来试验好好的,突然就出现这种情况,之前是出现

nested exception is javax.mail.MessagingException: 454 Command not permitted when TLS active

之前这个只有163邮箱会出现这个问题,而qq,yahoo,outlook都没有这个问题,但是使用

http://my.oschina.net/u/1246663/blog/166883


这个163邮箱却可以发送成功

你可能感兴趣的:(#,Java,Mail)