Develop Java Programs implementing 10 new concepts/features/Topics (not in our syllabus).
- Code
- Source - Javatpoint
.jarfiles- Steps:
- Get the session object: The
javax.mail.Sessionclass provides two methods to get the object of session,Session.getDefaultInstance()method andSession.getInstance()method. - Compose the message: The
javax.mail.Messageclass provides methods to compose the message. But it is an abstract class so its subclassjavax.mail.internet.MimeMessageclass is mostly used. To create the message, you need to pass session object inMimeMessageclass constructor. - Resolving Authentication failure: Click on this link and click on turn on radio button to allow users to send mail from unknown location.
- Get the session object: The