Welcome_Word 2017-02-20 06:31 采纳率: 100%
浏览 4117
已采纳

javamial 邮件发送报554

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

  • 写回答

3条回答 默认 最新

  • Welcome_Word 2017-02-20 06:35
    关注

    百度跟网易的解释是邮件有垃圾内容,但是如果这样没道理大部分情况下可以,偶尔出错,而且,有的邮箱可以有的邮箱不可以

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化