0

I am trying to send a Javamail using MailJet SMTP and port. Can this be done without using the GMAIL settings? Here's the code:

    props.put("mail.smtp.host", "in-v3.mailjet.com");
    props.put("mail.smtp.socketFactory.port", "587");
    props.put("mail.smtp.socketFactory.class",     "javax.net.ssl.SSLSocketFactory");
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.port", "587");
ebeneditos
  • 2,542
  • 1
  • 15
  • 35
  • You [don't need the socket factory properties](https://javaee.github.io/javamail/FAQ#commonmistakes). Obviously you don't need to use the Gmail settings since you're not using Gmail, but you do need to use settings that match what your server requires. If it's stlll not working, tell us what settings your server requires, update the property settings above, and show us the [JavaMail debug output](https://javaee.github.io/javamail/FAQ#debug). – Bill Shannon Apr 11 '18 at 15:33

1 Answers1

0

Those are settings known to work with Spring Boot 1.5 and 2.2:

spring.mail.host=in-v3.mailjet.com
spring.mail.port=587
spring.mail.username=<your username>
spring.mail.password=<your password>
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
spring.mail.test-connection=true
yglodt
  • 13,807
  • 14
  • 91
  • 127