type

MimeUtil

class MimeUtil : Obj

Utilities to deal with all the idiosyncrasies of MIME.

methods

toAddrSpec

Return the addr-spec or "local@domain" part of an email address string.

toEncodedWord

Encode the specified text into a "encoded word" according to RFC 2047.

Slot Details

toAddrSpec

static Str toAddrSpec(Str addr)

Return the addr-spec or "local@domain" part of an email address string. The result is always returned as "<addr>". The addresses may be formatted with or without a display name:

[email protected]                =>  <[email protected]>
Bob Smith <[email protected]>    =>  <[email protected]>
"Bob Smith" <[email protected]>  =>  <[email protected]>

toEncodedWord

static Str toEncodedWord(Str text)

Encode the specified text into a "encoded word" according to RFC 2047. If text is pure ASCII, then it is returned as is. Otherwise encode using UTF-8 Base64.