简体   繁体   English

apache骆驼邮件:通过smtps发送不起作用

[英]apache camel mail: sending over smtps not working

I'm using Apache Camel (plain Java) and want to get smtps to work. 我正在使用Apache Camel(普通Java),并且希望使smtps正常工作。 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? 我正在使用免费的gmx.at电子邮件帐户-这可能是原因吗? In case that there was something wrong with the port or SSL I assume that Camel would throw it back at me. 如果端口或SSL出现问题,我认为Camel会把它扔给我。 Does anyone know a free mail provider that works well with Camel? 有谁知道与Camel配合使用的免费邮件提供商? (doesn't need to have ssl because it's just for testing) (不需要ssl,因为它仅用于测试)

Thanks for all the input! 感谢所有的投入!

I succeeded by switching to Gmail and activating access for insecure apps in the preferences of the webUI. 我成功切换到Gmail并在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");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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