String encoded = null; try { encoded = MimeUtility.encodeText (subject, charset(), !charset().equals(DefaultCharset) ? "B" : null); } catch (Exception e) { encoded = subject; } this.mimeMessage ().setSubject (encoded);
this.mimeMessage ().setSubject (ERMailUtils.encodeString (subject, this.charset ()));
    public void setSubject (String subject) throws MessagingException {        String encoded = null;        try {            encoded = MimeUtility.encodeText (subject, charset(), !charset().equals(DefaultCharset) ? "B" : null);        } catch (Exception e) {            encoded = subject;        }        this.mimeMessage ().setSubject (encoded);    }