Python email.utils Functions

EditRocket provides the following information on email.utils functions in the Python source code builder.

collapse_rfc2231_value(value[, errors[, fallback_charset]]) -

decode_params(params) - Decode parameters list

decode_rfc2231(s) - Decode the string s

encode_rfc2231(s[, charset[, language]]) - Encode the string s

formataddr(pair) - The inverse of parseaddr(), this takes a 2-tuple of the form (realname, email_address) and returns the string value suitable for a To: or Cc: header.

formatdate([timeval[, localtime][, usegmt]]) - Returns a date string

getaddresses(fieldvalues) - This method returns a list of 2-tuples of the form returned by parseaddr().

make_msgid([idstring]) -

mktime_tz(tuple) - Turn a 10-tuple as returned by parsedate_tz() into a UTC timestamp.

parseaddr(address) - Parse address - which should be the value of some address-containing field such as To: or Cc: - into its constituent realname and email address parts.

parsedate(date) - Attempts to parse a date

parsedate_tz(date) - Performs the same function as parsedate(), but returns either None or a 10-tuple; the first 9 elements make up a tuple that can be passed directly to time.

quote(str) - Return a new string with backslashes in str replaced by two backslashes, and double quotes replaced by backslash-double quote.

unquote(str) - Return a new string which is an unquoted version of str.