MailService Project using Java javax.mail
-
Depedency
<dependency> <groupId>com.sun.mail</groupId> <artifactId>javax.mail</artifactId> <version>1.6.2</version> </dependency>
-
java.util.Properties ---> set pro like to sender hostname
-
javax.mail.Message -----> MimeMessage
-
javax.mail.MessagingException
-
javx.mail.PasswordAuthentication ---> authenticates for username and password
-
javax.mail.Session --> mail Session
-
javax.mail.Transport ---> send message
-
javax.mail.interent.InternetAddress ---> interet email address
-
javax.mail.internet.MimeMessage --->
-----------------------------STEPS
- get session
- compose mail
- send transport
Refer code attached