Mail is being clipped even when is so small, problem with accent in vowels (a, e, i, o, u to á, é, í, ó, ú)

Your email editor 'folds' the mail body when the 'body height' is 'beyond certain height' that the software watches for.

Now, your overall 'mail body height' is the sum of each line in your mail body. Now each letter has a height, and that is varying based on whether you are using letters with 'accents' on it, the 'height' of the letter with and without accent character need not be the same.

In this particular example, the former did not attract 'folding', while the latter did in the email software that you used.

Assuming you are viewing these three lines in a browser, you can research on 'line heights' in a browser 'developer tools' and finally determine that individual line heights are more when you used accented characters.

I bet, reduce the font size and you should not get that '...' (ellipsis). Below is a much more explosive discussing with thorough history and spec references and what not on technically dissecting a font.

When setting a font-size in CSS, what is the real height of the letters?


What I tried:

MimeMessage message = new MimeMessage(session);
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
message.setSubject("subject", "UTF-8"); // add encoding to support different languages...
message.setSentDate(new java.util.Date());
MimeBodyPart messageBodyPart = new MimeBodyPart();
String html = "<h2>RFC INVALIDOS en México:</h2>"+
                "<h4>Se adjunta el siguiente listado de RFC inválidos al día de la fecha.</h4>" +
                "<h3>Saludos!!!</h3>";
messageBodyPart.setContent(html, "text/html");
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
// send message
Transport.send(message);

Screenshot of the mail (all vowels and accents are present):

enter image description here

Hope this helps you :)

The reason for clipping message by Gmail (From MailChimp Article on Gmail Clipping)

Gmail clips emails that have a message size larger than 102 KB, and hides the full content behind a View entire message link.

So, if you want to avoid clipping of messages, then you have to keep the message size less than 102 KB.


Finally with the indirect help of @Anish B. I found the solution:

There is a class MimeMessageHelper and that class has several constructors:

public MimeMessageHelper(MimeMessage mimeMessage)

public MimeMessageHelper(MimeMessage mimeMessage, String encoding)

public MimeMessageHelper(MimeMessage mimeMessage, boolean multipart)

public MimeMessageHelper(MimeMessage mimeMessage, boolean multipart, String encoding)

I was using:

public MimeMessageHelper(MimeMessage mimeMessage, boolean multipart)

And I changed it for:

public MimeMessageHelper(MimeMessage mimeMessage, boolean multipart, String encoding)

And it looks like:

protected MimeMessageHelper createMimeMsg(MimeMessage mimeMessage) throws MessagingException {
        return new MimeMessageHelper(mimeMessage, true, "UTF-8");
    }

It looks like the default encoding is not "UTF-8", the defaul encoding is null for that helper. And even when I set the html as "UTF-8" it doesn't recognize it. I had to put it as a part of the subject encoding for mime.

So finally the problem is solved by giving the encoding correctly.