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
PasswordAuthenticationclass. - Replace
someone@email.comwith a real email.
- Discover the differences between
javax.mailandcom.sun.mail. - Send HTML messages.