Tutorial by Examples

This example shows how to establish a connection to an SSL-enabled POP3 email server and send a simple (text only) email. // Configure mail provider Properties props = new Properties(); props.put("mail.smtp.host", "smtp.mymailprovider.com"); props.put("ma...
public class GoogleMailTest { GoogleMailTest() { } public static void Send(final String username, final String password, String recipientEmail, String title, String message) throws AddressException, MessagingException { GoogleMailTest.Send(username, password, recipientE...
You can use the same Example above Send Simple Mail with a little modification. Use msg.setContent() instead of msg.setText() and use content type html as text/html. check this msg.setContent(message, "text/html; charset=utf-8"); instead of msg.setText(message);

Page 1 of 1