在ATG中,当调用该方法时,我得到了this.getSmtpEmailSender().sendEmailMessage(msg)
异常。但是相同的代码在不同的环境中工作正常。可能是配置问题。我需要检查什么。
/com/ncr/base/common/services/EmailService
java.lang.Exception: The final format argument for a vlog call is a throwable, but is not referenced. The throwable will be logged, but please use an explicit Throwable argument before the format string to eliminate ambiguity.
**** Warning Fri Dec 21 02:49:02 -05:00 2018 1545378542129 /com/ncr/base/common/services/EmailService at atg.nucleus.logging.VariableArgumentApplicationLoggingUtil.getUnreferencedThrowable(VariableArgumentApplicationLoggingUtil.java:744)
**** Warning Fri Dec 21 02:49:02 -05:00 2018 1545378542129 /com/ncr/base/common/services/EmailService at atg.nucleus.logging.VariableArgumentApplicationLoggingUtil.vlogError(VariableArgumentApplicationLoggingUtil.java:344)
/com/ncr/base/common/services/EmailService 嵌套异常为: com.sun.mail.smtp.SMTPSenderFailed异常: 501 5.1.7 地址无效
我的猜测是您的电子邮件地址之一在To
或From
字段中都无效。
ATG 允许您为/atg/dynamo/service/SMTPEmail/
组件配置默认值,我认为您缺少相关环境的配置。 我建议您打开 dyn/admin 并比较适用于正常工作环境的 SMTP 电子邮件配置与无效环境的配置。