Html 如何在Java Mail中添加内联样式而不中断行

Html 如何在Java Mail中添加内联样式而不中断行,html,css,styles,jakarta-mail,Html,Css,Styles,Jakarta Mail,我想在java邮件中为给定文本添加内联样式 <p>Please check the attachement to download the promotion letter with the password of your </p>" +"<b>"+ "NIC No + Birth Year (Example : 786083518 "+" <p style=\"color:red;\">1978)</p>" +"</b>

我想在java邮件中为给定文本添加内联样式

<p>Please check the attachement to download the promotion letter with the password of your </p>" +"<b>"+ "NIC No + Birth Year (Example : 786083518 "+" <p style=\"color:red;\">1978)</p>" +"</b>"
我想要的是同一排的红黑相间的1978年。

这就是你拥有的:

请查看附件以下载带有您的

NIC编号+出生年份密码的促销信示例:786083518

1978

您是否尝试使用div或span代替段落