• Post Reply Bookmark Topic Watch Topic
  • New Topic

Emailing from a Servlet  RSS feed

 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to send an email to an extenal provider (gmail) and this is what happend:

This is the code in the Servlet:




And this is the class Mailer:



I get the next errors:


I searched on the net and I got no where for this specifc case

Any idea, please?

Regards, Isaac
 
Ron McLeod
Saloon Keeper
Posts: 1600
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To fix your Unknown SMTP host problem, you could probably use a mail host of smtp.gmail.com, but in addition, you may need to use SMTPS protocol rather than SMTP.
 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed and I got this results:



The piece of code Im using now is as follows:


Any more tip,please?
 
Ron McLeod
Saloon Keeper
Posts: 1600
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You incorrectly changed the property key rather than the value. It should be like this:
Even after than, you will just hit the next set of road blocks. These write-ups will help:
   Send email with SMTPS (eg. Google GMail) (Javamail)
   Allowing less secure apps to access your account
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!