Steps to create a text Email
- Create
Emailinstance. - Set the host name of the server
smtp.googlemail.com - Set email account details .
- Set email address for To and From.
- Set Email subject and content of the Email.
- Finally sending mail
SourceFile:
TextEmail.java
Output:
Email sent successfully
For verification purpose, check in receivers inbox.
Download: Commons API-Sending email using Gmail SSL
0 comments :
Post a Comment