|
Home |
WebServices
| Maven |
SOA |
REST
| Agile & SCRUM |
Java & JEE
|
     |
| | | | | |
:: Best Training & events on Java & JEE |
|
Send email using Gmail and Java Mail API
This tutorial explains how to send email using gmail and java mail API and also mentions
the necessary jar files that are required.
Step 1: Please download Java Mail
and ensure activation.jar, mailapi.jar and smtp.jar are in the classpath.
Step 2: TheaMailConfig.java contains the configurations needed as shown in
the below screen shot.
Step 3: TheaMail.java just contains getters and setters
needed for representing email parameters as in the screen shot below.
Step 4: TheaMailer.java creates a Session
and send mail. The source code is as in the screen shot below.
Step 5: Test.java invokes the code to send email
as in the screen shot below.
|
|
Copyrights 2008 Thea Solutions
All rights reserved |
Powered by 4creativeweb Solutions |
|