How to send a mail in java to Gmail, when “Allow less secure apps: OFF”

余生颓废 提交于 2019-12-06 03:55:05

Upgrade to a more secure app that uses the most up to date security measures.

How:

It pretty simple, you just need to go through all the steps, everything is well explained.

If you dont have 2 step verification turned on then the following tutorial will allow you to send mail through GMail using javax.mail with little to no fuss. It uses SSL during transport but on slightly less restrictive port (587 as opposed to 465), you will have to remember to make sure to add the ("mail.smtp.starttls.enable", "true") property or you will not be using SSL. Its also worthwhile remembereing that this method will try to use ssl but if the server doesnt have ssl capabilities it WILL transmit in plain-text.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!