如何在不换行的情况下在 Java 邮件中添加内联样式

How to add inline Styles in Java Mail without breaking a line

我想为 java mail.if 中的给定文本添加内联样式,我添加如下输出。

<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红)黑在同一行

这是你拥有的:

<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>

您可以使用以下内容:

<p>Please check the attachement to download the promotion letter with the password of your <b>NIC No + Birth Year (Example : 786083518 <span style="color:red;">1978)</span></b></p>