 {
    // If we know for sure that rawvalue contains only US-ASCII 
    // characters, we can skip the encoding part
    part.setHeader("X-mailer", MimeUtility.encodeText(rawvalue));
  } catch (UnsupportedEncodingException e) {
    // encoding failure
  } catch (MessagingException me) {
   // setHeader() failure
  }

 </pre></blockquote><p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - Unicode string</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Unicod