This tutorial shows how to send emails in Java. The libraries used in the tutorial project are javax.mail
and javax.activation
.
To customise the project to make sure it runnable, you need to change the following values in SendEmail
class to fit with your project.
- Properties of the mail server. In my example, I use gmail.
- username and password for
PasswordAuthentication
class. - Replace
[email protected]
with a real email.
- Discover the differences between
javax.mail
andcom.sun.mail
. - Send HTML messages.