简体   繁体   中英

apache camel mail: sending over smtps not working

I'm using Apache Camel (plain Java) and want to get smtps to work. Basically I just want to send a file via email and my route seems to start without problems, but no mail is sent and no error/exception is thrown.

INFO  Route: route7 started and consuming from: Endpoint[file://src/File.jpg?noop=true]

Interestingly the log "Sending Mail" is not shown.

My route class looks as follows:

public class SendToDepartment extends RouteBuilder {

public void configure() throws Exception {

    from("file:src/data/attachments/File.jpg?noop=true")
            .setHeader("subject", simple("New application"))
            .log("")
            .to("smtps://myname@gmx.at?password=secretpw&to=recipient@mail.com");
    }


}

Am I overlooking something here? I am using a free gmx.at email account - could this be the reason? In case that there was something wrong with the port or SSL I assume that Camel would throw it back at me. Does anyone know a free mail provider that works well with Camel? (doesn't need to have ssl because it's just for testing)

Thanks for all the input!

I succeeded by switching to Gmail and activating access for insecure apps in the preferences of the webUI. If anyone wants to do something similar, the last line looks like this now:

.to("smtps://smtp.gmail.com?username=fullemailaddress&password=secretpw&to=recipient@mail.com");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM