Apache Camel Mail:当我们只有Mail Host时如何发送电子邮件?

问题描述 投票:0回答:1

以下是我的代码:

from("file:input?noop=true")
                    .log(LoggingLevel.INFO, "Read from the input file")
                    .setHeader("to", simple("[email protected]"))
                    .to("smtps://scan.buzu.com")

[在较早的Java代码中,我们只给(any xyz)和from(any xyz),并且仅托管scan.buzu.com。我们没有其他参数,例如,没有用户名,密码或其他任何参数,我不确定上述实现是否可以仅使用主机名来实现?

当我将其从smtps更改为smptp时,它说是飘摇

Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 504 5.5.2 <camel@localhost>: Sender address rejected: need fully-qualified address

但我没有任何用户或任何可登录的地方。

apache-camel apache-camel-mail
1个回答
0
投票

通过添加xyz Sender以及smtp代替smtps来解决:

from("file:input?noop=true")
                .log(LoggingLevel.INFO, "Read from the input file")
                .setHeader("to", simple("[email protected]"))
                .setHeader("from", simple("[email protected]"))
                .to("smtp://scan.buzu.com")
© www.soinside.com 2019 - 2024. All rights reserved.