SeunMatt / mysql-backup4j

mysql-backup4j is a library for programmatically exporting mysql databases and sending the zipped dump to email, Amazon S3, Google Drive or any other cloud storage of choice
MIT License
124 stars 71 forks source link

javax.mail.MessagingException: Could not convert socket to TLS; #18

Closed ahmeedev closed 3 years ago

ahmeedev commented 3 years ago

image

javax.mail.MessagingException: Could not convert socket to TLS; nested exception is: javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:1652) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:534) at javax.mail.Service.connect(Service.java:313) at javax.mail.Service.connect(Service.java:172) at javax.mail.Service.connect(Service.java:121) at javax.mail.Transport.send0(Transport.java:190) at javax.mail.Transport.send(Transport.java:120) at com.smattme.EmailService.sendMail(EmailService.java:149) at com.smattme.MysqlExportService.export(MysqlExportService.java:298) at com.atcollection.dashboard.setting.Setting.lambda$emailBackup$0(Setting.java:205) at java.base/java.lang.Thread.run(Thread.java:832) Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131) at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)

SeunMatt commented 3 years ago

Hello @ahmadbintariq4u

This exception has to do with Java mail not able to communicate with Mailtrap. You should check your Mailtrap config, the email port is usually 2525 and the username and password are usually alphanumeric and not your Gmail account

ahmeedev commented 3 years ago

@SeunMatt Thanks bro. one more thing.. Is the EMAIL_FROM && EMAIL_TO is the gmails?

SeunMatt commented 3 years ago

The EMAIL_TO is the email where the zipped backup files will be sent, it can be any valid email - Gmail or others. The EMAIL_FROM can also be any valid email address.

SeunMatt commented 3 years ago

cc @ahmadbintariq4u