Send Email Using JavaMail

JavaMail, a technology from Java allows programmers to develop code that can send emails whether in plain text or HTML. Here’s a short easy code to send email to a recipient.

Notice the line that says transport.connect(USERNAME, PASSWORD);

That line is optional in case you have set your SMTP server for authentication before emails are sent out by the mail server. The method also provides the option to let you send the email as plain text or HTML. Just set the value to html if you want it to be sent as HTML.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *