MailSender
MailSender copied to clipboard
Android 11 not sending Mail
On Android 11 not sending mail with exception check code and error below
val mail = Mail().apply {
mailServerHost = SERVER_MAIL_HOST
mailServerPort = SERVER_MAIL_PORT
fromAddress = FROM_ADDRESS
password = FROM_ADDRESS_PASSWORD
toAddress = arrayListOf(email)
subject = "Subject"
content = "Message"
openSSL = true
}
MailSender.getInstance().sendMail(mail, object : MailSender.OnMailSendListener {
override fun onError(e: Throwable) {
}
override fun onSuccess() {
}
})
java.lang.VerifyError: Rejecting class com.sun.mail.handlers.text_html that attempts to sub-type erroneous class com.sun.mail.handlers.text_plain (declaration of 'com.sun.mail.handlers.text_html' appears in /data/app/~~YHjCQK5GsYs7gkjB5R6Psw==/com.example.myapp-cKn0YFhpNVo1Qj20ZUqtOg==/base.apk!classes25.dex)
I have the same error!
↑ same problem
finally smth, faced same issue too!