0

我目前正在尝试通过 ShinyProxy 和 Docker 发布我的 Shiny 应用程序。

不幸的是,我的应用程序在发布后无法运行 - 在 PC 本身上它可以正常运行。

我的问题之一涉及“mailR”包。当我尝试发送电子邮件时收到以下错误消息(摘录,您可以在下面找到整个日志):

警告:错误:EmailException (Java):将电子邮件发送到以下服务器失败:smtp.gmail.com:587

我已经尝试使用 SSL 端口(465)而不是 TLS 端口 - 不幸的是没有成功。

我不得不承认我并不真正了解 SSL 和 TLS - 所以这可能是因为我没有“安装”任何证书(?)。正如我之前所说,该程序在我的 PC 上运行没有任何问题。

这是一些背景信息:我的服务器在 Ubuntu 上运行。我将 Docker 与 ShinyProxy 结合使用。我使用包“mailR”和 Java 版本 8。您可以在帖子末尾找到我的代码。

如果您需要更多信息,请随时告诉我到底是什么:)

非常感谢和最好的问候


完整的错误信息

org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:587
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1410)
at org.apache.commons.mail.Email.send(Email.java:1437)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at RJavaTools.invokeMethod(RJavaTools.java:386)
Caused by: javax.mail.MessagingException: Could not convert socket to TLS;
  nested exception is:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1999)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:709)
at javax.mail.Service.connect(Service.java:386)
at javax.mail.Service.connect(Service.java:245)
at javax.mail.Service.connect(Service.java:194)
at javax.mail.Transport.send0(Transport.java:253)
at javax.mail.Transport.send(Transport.java:124)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1400)
... 6 more
Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at sun.security.ssl.HandshakeContext.<init>(HandshakeContext.java:171)
at sun.security.ssl.ClientHandshakeContext.<init>(ClientHandshakeContext.java:98)
at sun.security.ssl.TransportContext.kickstart(TransportContext.java:220)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:428)
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:543)
at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:480)
at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1994)
... 13 more
Warning: Error in : EmailException (Java): Sending the email to the following server failed : smtp.gmail.com:587
  1: shiny::runApp

发送电子邮件的代码提取

send.mail(from="XMail@gmail.com",
          to="YMail@outlook.de",
          subject="Test Email",
          body="PFA the desired document",
          html=T,
          smtp=list(host.name = "smtp.gmail.com",
                    port = 465, #or 587
                    user.name = "XMail@gmail.com",
                    passwd = "XPassword",
                    ssl = T), #or tls = T
          authenticate=T,
          attach.files=Pn)
4

0 回答 0