gpt4 book ai didi

java - Apache Camel 邮件: sending over smtps not working

转载 作者:行者123 更新时间:2023-11-30 03:25:38 25 4
gpt4 key购买 nike

我正在使用 Apache Camel(纯 Java)并且想让 smtps 工作。基本上我只想通过电子邮件发送文件,我的路线似乎开始没有问题,但没有发送邮件,也没有抛出错误/异常。

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

有趣的是,日志“发送邮件”没有显示。

我的路线类如下所示:

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");
}


}

我在这里忽略了什么吗?我正在使用免费的 gmx.at 电子邮件帐户 - 这可能是原因吗?如果端口或 SSL 出现问题,我认为 Camel 会将其返回给我。有谁知道与 Camel 配合良好的免费邮件提供商吗? (不需要ssl,因为它只是用于测试)

最佳答案

感谢您的所有意见!

我成功地切换到 Gmail 并在 WebUI 的首选项中激活对不安全应用程序的访问。如果有人想做类似的事情,最后一行现在看起来像这样:

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

关于java - Apache Camel 邮件: sending over smtps not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30313086/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com