Link to home
Start Free TrialLog in
Avatar of victoriaharry
victoriaharry

asked on

Must issue a STARTTLS command first when sending email from jenkins

Hi Experts,

I have jenkins installed on my windows desktop and having issues configuring it to send emails from my outlook account as it uses TLS instead of SSL. I have done some research and some forums suggested adding the JENKINS_JAVA_OPTIONS to the jenkins.xml file and doing a restart however this didn't work for me.

JENKINS_JAVA_OPTIONS      -Djava.awt.headless=true -Dmail.smtp.starttls.enable=true

My SMTP settings are
SERVER smtp-mail.outlook.com
SMTP PORT 587
Use SSL unchecked
Username *****
Password ******

Error is below
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first


      at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057)

      at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1580)

      at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1097)

      at javax.mail.Transport.send0(Transport.java:195)

      at javax.mail.Transport.send(Transport.java:124)

      at hudson.tasks.Mailer$DescriptorImpl.doSendTestMail(Mailer.java:581)

      at java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source)

      at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)

      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
Avatar of Adam Brown
Adam Brown
Flag of United States of America image

Put a checkmark in the Use SSL box. SSL and TLS are essentially two terms for the same thing when you're talking about communicating with SMTP servers. TLS is a newer type of encryption and technically distinct from SSL, but email clients don't actually use SSL encryption when sending email. POP3 and IMAP can use SSL, but SMTP can't, and only uses TLS encryption via the STARTTLS verb. Because IMAP and POP3 do use it, though, a lot of mail clients got into the habit of using SSL as a generic term for encryption. This is also common when referring to Digital Certificates. Those are regularly called "SSL Certificates" even though they can be used for many different things other than SSL.
Avatar of victoriaharry
victoriaharry

ASKER

Thanks for  thefast reply. If I uncheck the SSL box I get a different error

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
I mean if I check it
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial