Message message = new MimeMessage(session);
message.setFrom(new InternetAddress(fromEmail));
message.setRecipient(Message.RecipientType.TO, new InternetAddress(toEmail));
message.setFileName("abc.xls");
message.setText("Fill the content:");
Above is the main part of code which I am using. While I use the above code, i don't see main body content "Fill the content" in the sent mail. There are other posts and comments which have piece of code which works that's this problem cab be resolved by using MimeMultipart & MimeBodyPart class. But no where it's explained the reason of why the above code is not working.
I am also aware that using setFileName is not enough to add the content present inside the file, it's just used to add the attachment without content.
Note: I am using javax.mail-1.5.0.jar
Can you please explain the reason of the above code not working?
Thanks in advance.