I am using Apache mail to send emails from my Gmail account, as follows:
HtmlEmail email = new HtmlEmail();
email.setHostName("smtp.gmail.com");
email.setSmtpPort(465);
email.setAuthenticator(new DefaultAuthenticator("mygmailaccount@mydomain.com", "mypassword"));
email.setSSLOnConnect(true);
email.setFrom("no-reply",
"appName");
@Async
public void send(HtmlEmail email) throws EmailException {
email.send();
}
I am using spring framework to run tasks asynchronously.
This works fine on my local machine, but when trying to run the code from CloudBees, I don't get the email in my inbox although I didn't find anything unusual in the debugs.
Can anyone please advise about this issue ?