title: Can I add HTML tags to the email subject using JavaMail API?
body: <p>I want to add the "white-space:nowrap" CSS property for certain two words in my email subject using <a href="https://javaee.github.io/javamail/" rel="nofollow noreferrer">JavaMail API</a>.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>String str = "These &lt;span style='white-space: nowrap'&gt;Two words&lt;/span&gt;";
  mail.setSubject(str, "UTF-8");
  </code></pre>
  
  <p>But when I view in email client, subject has been displayed as <em>text</em>, not in HTML format.</p>
  
  <pre><code>These &lt;span style='white-space: nowrap'&gt;Two words&lt;/span&gt;
  </code></pre>
  
  <p><br>
  Please let me know what could be the problem.</p>