java Mail 发送外部邮件失败,求解,
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java Mail 发送外部邮件失败,求解,相关的知识,希望对你有一定的参考价值。
javaMail版本1.4 如果通过javaMail向内部的exchange邮箱发邮件是能发出去的.
但是如果向163,QQ等邮箱发邮件的话会报以下错误
javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
at com.smartdot.mau.mail.MailSend.sendhtmlMail(MailSend.java:308)
at com.smartdot.mau.thread.SendMailThread.run(SendMailThread.java:34)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
... 6 more
用163邮箱可以通过javamail代码向其他邮箱发送邮件,但是用公司自己内部的邮箱就报这个错,但是我用foxmail登陆公司邮箱然后发送给其他的邮箱就不行,一直报这个错
jenkins 发送邮件失败
jenkins 配置发送邮件,发送测试邮件,邮件发送失败:
Failed to send out e-mail
javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
at javax.mail.Service.connect(Service.java:295)
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 hudson.tasks.Mailer$DescriptorImpl.doSendTestMail(Mailer.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:335)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:175)
以上是关于java Mail 发送外部邮件失败,求解,的主要内容,如果未能解决你的问题,请参考以下文章