₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,163 members, 8,510,467 topics. Date: Friday, 30 October 2026 at 12:45 PM

Toggle theme

Sending Email With Java In HTML Format (javamail API) - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › Sending Email With Java In HTML Format (javamail API) (716 Views)

1 Reply

Sending Email With Java In HTML Format (javamail API) by Anatech(op): 1:56am On May 07, 2015
Sending email with Java

You can insert HTML tags when sending email in text format but that isn’t enough to make the e-mail interpreted as an HTML e-mail in a web mail or an e-mail client program. So, instead of using:

First of all, download the Java Mail jar file (to add to your Classpath)


Message msg = new MimeMessage(session);
msg.setText(message);

we should invoke the setContent(Object obj, String type) method of the MimeMessage object. The setContent() method specifies the mime type of the content explicitly, and for HTML format, the type parameter must be “text/html”:

<a href="http://www.anatech.com.ng/sending-email-with-java/">Read More</a>
1 Reply

Can I Claim Expert In Html,javascript,css & Php After 1yrs Of Constant Learning? • Learning To Program With Java by the Fulaman • How Can I Learn OOP With Java? • 2 • 3 • 4

. • .. • How Can I Download Django.om My Phone