(grails)com.sun.mail.smtp.SMTPSendFailedException:553不允许作为zoho邮件进行中继 [英] (grails) com.sun.mail.smtp.SMTPSendFailedException: 553 Relaying disallowed as zoho mail

查看:344
本文介绍了(grails)com.sun.mail.smtp.SMTPSendFailedException:553不允许作为zoho邮件进行中继的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在grails 邮件插件中配置zoho邮件服务.到目前为止,这是我的配置,

I am trying to configure zoho mail service in grails mail-plugin. Here is my configuration so far,

    grails {
    mail {
        host = "smtp.zoho.com"
        port = 465
        username = "email@valid.com"
        password = "some-valid-password"
        props = ["mail.smtp.auth":"true",
                 "mail.smtp.starttls.enable":"true",
                 "mail.smtp.socketFactory.port":"465",
                 "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
                 "mail.smtp.socketFactory.fallback":"false"]
    }
}

这是我的服务方式.如果我放置gmail smtp配置,则上面的配置效果很好,因此我认为服务方法完全没有问题.另外email@valid.com是Zoho中的注册电子邮件,我可以使用zoho仪表板发送电子邮件.

Here is my service method. The above config works great if I put gmail smtp configuration, so I think there is no problem with service method at all. Also email@valid.com is a registered email in Zoho and I can send email using zoho dashboard.



    def sendImageProcessedNotification(User user, imageLink){
            try{
                if(user){
                    def receiver = user.email
                    mailService.sendMail {
                        async true
                        to receiver
                        subject "Subject"
                        html "Html body"
                    }
                }
            }catch(e){
                log.error(e)
            }
        }

这是堆栈跟踪,



    2015-07-19 08:17:37,782 [pool-12-thread-1] ERROR mail.MailMessageBuilder  - Failed to send email
    org.springframework.mail.MailSendException: Failed to close server connection after message failures; nested exception is javax.mail.MessagingException: Can't send command to SMTP host;
      nested exception is:
        java.net.SocketException: Connection closed by remote host. Failed messages: com.sun.mail.smtp.SMTPSendFailedException: 553 Relaying disallowed as 
    ; message exception details (1) are:
    Failed message 1:
    com.sun.mail.smtp.SMTPSendFailedException: 553 Relaying disallowed as 

        at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2133)
        at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1912)
        at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1135)
        at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:433)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:345)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)
        at org.springframework.mail.javamail.JavaMailSender$send$0.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:122)
        at grails.plugin.mail.MailMessageBuilder$_sendMessage_closure1.doCall(MailMessageBuilder.groovy:112)
        at grails.plugin.mail.MailMessageBuilder$_sendMessage_closure1.doCall(MailMessageBuilder.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1121)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at groovy.lang.Closure.call(Closure.java:423)
        at groovy.lang.Closure.call(Closure.java:417)
        at groovy.lang.Closure.run(Closure.java:504)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

推荐答案

删除此行"mail.smtp.starttls.enable":"true",添加此行"mail.smtp.startssl.enable":true

这篇关于(grails)com.sun.mail.smtp.SMTPSendFailedException:553不允许作为zoho邮件进行中继的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆