com.sun.mail.smtp.SMTPSendFailedException: 554 DT:SPM 163 smtp9,DcCowAC3PsuoiqpYR4q8Ig--.10814S2 1487571625,please see http://mail.163.com/help/help_spam_16.htm?ip=125.90.50.8&hostid=smtp9&time=1487571625
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1668)
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1473)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:738)
at javax.mail.Transport.send0(Transport.java:191)
at javax.mail.Transport.send(Transport.java:120)
at cn.dmandp.web.servlet.EmailVerifyServlet.doPost(EmailVerifyServlet.java:143)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at cn.dmandp.filter.EncodingFilter.doFilter(EncodingFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
代码应该是没有错的,因为它经常可以发出去,就是偶尔会报554,但是还是把代码贴出来,求大神帮忙看看,怎么解决,现在就是我常用邮箱大部分可以成功发送,偶尔出现554,新申请本来打算用作专用邮箱的结果是一封邮件也发不出去,一直554,同样的邮件内容;代码如下:
//发email-----------start
Properties props=new Properties();
Properties mymailprops=new Properties();
InputStream pis=this.getClass().getClassLoader().getResourceAsStream("Jmail.properties");
InputStream mymailpis=this.getClass().getClassLoader().getResourceAsStream("mymail.properties");
props.load(pis);
mymailprops.load(mymailpis);
Authenticator authenticator=new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(mymailprops.getProperty("accountname"),mymailprops.getProperty("password"));
}
};
Session session=Session.getInstance(props,authenticator);
MimeMessage msg=new MimeMessage(session);
try {
msg.setFrom(new InternetAddress(mymailprops.getProperty("fromAddress")));
msg.setRecipients(RecipientType.TO, form.getEmail());
msg.setRecipients(RecipientType.CC,mymailprops.getProperty("fromAddress"));
msg.setSubject("dmandp");
msg.setContent("欢迎加入dmandp,你的验证码为["+codes+"],请尽快完成验证.若非本人操作,请忽略此邮件.","text/html;charset=utf-8");
Transport.send(msg);
//发email-------------end