Apache Camel Mail: How to send email when we have Mail Host only?

723 Views Asked by At

Following is my code:

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

In earlier java codes, we just give to(any xyz) and from(any xyz) and host only scan.buzu.com. No other parameter we give i.e no username, or password or anything I am not sure if the above implementation is fine in camel to achieve using hostname only?

When i change it from smtps to smptp, It says fllowing

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

but i do not have any user or anything to login.

1

There are 1 best solutions below

0
On

Fixed it by adding xyz Sender as well as smtp in place of 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")