Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

18
  • Have error message: Could not connect to SMTP host: smtp.gmail.com, port: 465(also with 587). Commented Jun 10, 2020 at 8:50
  • Did you try TLS? port 587 Commented Jun 10, 2020 at 8:51
  • maybe i am doing something wrong,i just copied your code, writed in ''final String username,final String password'' my email address and my password. Commented Jun 10, 2020 at 8:57
  • correct , try to generate an application password as well Commented Jun 10, 2020 at 8:59
  • I updated my answer, check it out if it works for you, i think you should be fine now,you will need an application password from your google account, you can get it from the security tab Commented Jun 10, 2020 at 9:03