Java Email Application
Using JavaMail API to send emails using SMTP from Java applications:
i. Clone the git repo
https://github.com/Vedantu18/EmailApplication.git
ii. Open project folder
iii. Explore
😎
To send emails:
src/main/java/com/application/SimpleEmail.java
,src/main/java/com/application/TLSEmail.java
,src/main/java/com/application/SSLEmail.java
.java.net.UnknownHostException
comes when your system is not able to resolve the IP address for the SMTP server, it might be wrong or not accessible from your network. For example, GMail SMTP server is smtp.gmail.com
and if I use smtp.google.com
, I will get this exception. If the hostname is correct, try to ping the server through command line to make sure it’s accessible from your system.Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Author: Pankaj (Developer and author at DigitalOcean)
Tutorial Title: JavaMail Example - Send Mail in Java using SMTP
Tutorial URL: https://www.digitalocean.com/community/tutorials/javamail-example-send-mail-in-java-smtp
Date: July 4, 2024