Using org.apache.commons.mail.SimpleEmail to send an email from within a background application. This has been working for 8 months with no problems. On January 1st it started failing. The application is Scala (2.12.8) and Java (1.8) running on a Mac (macOS 10.15.7).
Sending the email to smtp.googlemail.com port 465 (also tried smtp.gmail.com).
Using IntelliJ as the IDE. If the application runs within IntelliJ, it still works perfectly, but if you create a Jar and run from the command line it fails every time. Running from a Jar using 'sudo' also fails.
So did some setting change at Google as of Jan 1? Why would it still work within the IDE - is there a context or certificate present within IntelliJ? A certificate needed for SSL?
Appreciate any suggestions!
-------- Addendum - all parameters to the send() method ---------
Heading: FAILURE --- my addition
ID: (None) --- my addition
To: [email protected]
Subject: Backup for JDCMacBook was 150.1M
Message: For JDCMacBook, Drive: USBExtA, Backup 2021-01-08-103310 compared to 2021-01-08-053055 Adds: 3.3M Changes: 142.3M Deletes: 4.4M
SendIfPossible: true
To Host: smtp.googlemail.com
To Port: 465
Auth User: [email protected]
Auth Pwd: .... redacted ....
Set SSL: true
------- Stack trace -----------
Exception: org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.googlemail.com:465
10:44:11.749 0:00.002 ERROR: org.apache.commons.mail.Email.sendMimeMessage(Email.java:1469)
10:44:11.749 ERROR: org.apache.commons.mail.Email.send(Email.java:1496)
10:44:11.749 ERROR: jdctm.Utils$.sendEMail(Utils.scala:547)
10:44:11.750 0:00.001 ERROR: jdctm.NotifyInfo.notify(Cache.scala:1036)
10:44:11.750 ERROR: jdctm.Cache$.notify(Cache.scala:722)
10:44:11.750 ERROR: jdctm.ExecuteTMUtil.run(Cache.scala:952)
10:44:11.750 ERROR: java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
10:44:11.751 0:00.001 ERROR: java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
10:44:11.751 ERROR: java.base/java.lang.Thread.run(Thread.java:831)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…