I sent the complaint letter with Java without problems, but Im now trying to send html one of them as follows:
MimeMessage message = new MimeMessage(Email.getSession());
message.setFrom(new InternetAddress("support@jthink.net"));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to, true));
message.setSubject(subject);
message.setContent(msg, "text/html");
message.setText(msg);
message.saveChanges();
Transport.send(message);
However, when I receive it in my client, it receives it as a text email, i.e. it displays all html tags instead of being used for formatting, and I checked the email header and it says
Content-Type: text/plain; charset=us-ascii
in the mail header
but why, because I pass "text / html" to the setContent () method, and this seems to be the only thing you need to do.
source
share