Hi,
Please see that working method that reproduces this issue (using latest 19.1 version):
public static void createTask() {
MapiTask tmpTask = new MapiTask(“Test task”, null, Date.from(LocalDate.now().plusDays(5).atStartOfDay(ZoneId.systemDefault()).toInstant()),
Date.from(LocalDate.now().plusDays(10).atStartOfDay(ZoneId.systemDefault()).toInstant()));
PersonalStorage pst = PersonalStorage.create("/tmp/pst1.pst", 0);
FolderInfo tasksFolder = pst.createPredefinedFolder(“Tasks”, StandardIpmFolder.Tasks);
tmpTask.setBodyContent("<html>\n" +
“<head>\n” +
“<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8”>\n” +
“<meta name=“Generator” content=“Microsoft Exchange Server”>\n” +
“<!-- converted from rtf -->\n” +
“<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>\n” +
“</head>\n” +
“<body>\n” +
“<font face=“Calibri” size=“2”><span style=“font-size:11pt;”>\n” +
“<table width=“798” style=“width:478.8pt;”>\n” +
“<col width=“199” style=“width:119.7pt;”>\n” +
“<col width=“199” style=“width:119.7pt;”>\n” +
“<col width=“199” style=“width:119.7pt;”>\n” +
“<col width=“199” style=“width:119.7pt;”>\n” +
“<tr>\n” +
“<td style=“background-color:black;”><font color=”#CFCFCF"><span style=“background-color:black;”><span style=“background-color:yellow;”><b>Test</b></span></span></font></td>\n" +
“<td style=“background-color:black;”><font color=”#CFCFCF"><span style=“background-color:black;”><b>1</b></span></font></td>\n" +
“<td style=“background-color:black;”><font color=”#CFCFCF"><span style=“background-color:black;”><b>2</b></span></font></td>\n" +
“<td style=“background-color:black;”><font color=”#CFCFCF"><span style=“background-color:black;”><b>3</b></span></font></td>\n" +
“</tr>\n” +
“<tr>\n” +
“<td style=“background-color:black;”><font color=”#CFCFCF"><span style=“background-color:black;”><b>A</b></span></font></td>\n" +
“<td style=“background-color:#999999;”><span style=“background-color:#999999;”>asdasda</span></td>\n” +
“<td style=“background-color:#999999;”><span style=“background-color:#999999;”>\n” +
“<ul style=“margin:0;padding-left:36pt;”>\n” +
“<li></li></ul>\n” +
“</span></td>\n” +
“<td style=“background-color:#999999;”><span style=“background-color:#999999;”>\n” +
“<ul style=“margin:0;padding-left:36pt;”>\n” +
“<li></li></ul>\n” +
“</span></td>\n” +
“</tr>\n” +
“<tr>\n” +
“<td style=“background-color:black;”><font color=”#CFCFCF"><span style=“background-color:black;”><b>B</b></span></font></td>\n" +
“<td style=“background-color:#CCCCCC;”><span style=“background-color:#CCCCCC;”>\n” +
“<ul style=“margin:0;padding-left:36pt;”>\n” +
“<li></li></ul>\n” +
“</span></td>\n” +
“<td style=“background-color:#CCCCCC;”><span style=“background-color:#CCCCCC;”>dasd</span></td>\n” +
“<td style=“background-color:#CCCCCC;”><span style=“background-color:#CCCCCC;”>asdad</span></td>\n” +
“</tr>\n” +
“<tr>\n” +
“<td style=“background-color:black;”><font color=”#CFCFCF"><span style=“background-color:black;”><b>C</b></span></font></td>\n" +
“<td style=“background-color:#999999;”><span style=“background-color:#999999;”>1)</span></td>\n” +
“<td style=“background-color:#999999;”><span style=“background-color:#999999;”>\n” +
“<ul style=“margin:0;padding-left:36pt;”>\n” +
“<li>2)</li></ul>\n” +
“</span></td>\n” +
“<td style=“background-color:#999999;”><span style=“background-color:#999999;”>\n” +
“<ul style=“margin:0;padding-left:36pt;”>\n” +
“<li>3)</li></ul>\n” +
“</span></td>\n” +
“</tr>\n” +
“</table>\n” +
“<div> </div>\n” +
“<div> </div>\n” +
“<div> </div>\n” +
“<div>Test – <b>Formatting Bold</b></div>\n” +
“<div>Test – <i>Formatting Italic </i></div>\n” +
“<div>Test – <u>Formatting Under</u></div>\n” +
“<div> </div>\n” +
“</span></font>\n” +
“</body>\n” +
“</html>”, BodyContentType.Html);
tasksFolder.addMapiMessageItem(tmpTask);
pst.dispose();
}
Thanks