Skip to main content
21 events
when toggle format what by license comment
Jun 11, 2020 at 10:08 comment added Phill Alexakis okay! that's great
Jun 11, 2020 at 10:06 comment added Shayimerdan I used the code from downstairs,and worked
Jun 11, 2020 at 9:25 comment added Phill Alexakis No problem, did it work?
Jun 10, 2020 at 12:03 comment added Phill Alexakis you also need to use javax.mail dependancy , i used version 1.4.7
Jun 10, 2020 at 11:59 comment added Phill Alexakis i doubt it, works for almost everyone, are you sure that is not blocked by your firewall? maybe try to turn off your firewall for a second and try sending it!
Jun 10, 2020 at 11:55 comment added Shayimerdan maybe i have to change some sittings on gmail or?
Jun 10, 2020 at 11:54 comment added Phill Alexakis yeah it's pretty odd, did you look it up?
Jun 10, 2020 at 11:30 comment added Shayimerdan yeah i tried but same error.but i feel like i am really close to success with your code.i just need to fix this: Could not connect to SMTP host: smtp.gmail.com, port: 587;
Jun 10, 2020 at 11:24 comment added Phill Alexakis It works for me, so it should for you too!
Jun 10, 2020 at 11:21 comment added Phill Alexakis Note that the first parameter has to be a valid e-mail address, you can make sendEmail static, and refer to it like this: sendEmail("[email protected]","blabla","blabla","blabla","blabla","blabla");
Jun 10, 2020 at 10:36 comment added Shayimerdan yes i just writed username and password,and used the method in Controller: SendEmail se = new SendEmail(); se.sendEmail("blabla", "blabla", "blabla", "blabla", "blabla", "blabla");
Jun 10, 2020 at 10:04 comment added Phill Alexakis did you use the new method i posted? try to put the same props of sendEmail
Jun 10, 2020 at 9:45 comment added Shayimerdan thank you for the help,but still have the same error message.javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
Jun 10, 2020 at 9:07 history edited Phill Alexakis CC BY-SA 4.0
Updated With Output
Jun 10, 2020 at 9:03 comment added Phill Alexakis 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
Jun 10, 2020 at 9:02 history edited Phill Alexakis CC BY-SA 4.0
Updated With Output
Jun 10, 2020 at 8:59 comment added Phill Alexakis correct , try to generate an application password as well
Jun 10, 2020 at 8:57 comment added Shayimerdan 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.
Jun 10, 2020 at 8:51 comment added Phill Alexakis Did you try TLS? port 587
Jun 10, 2020 at 8:50 comment added Shayimerdan Have error message: Could not connect to SMTP host: smtp.gmail.com, port: 465(also with 587).
Jun 10, 2020 at 8:44 history answered Phill Alexakis CC BY-SA 4.0