email.message.Message.set_param()

set_param(param, value, header='Content-Type', requote=True, charset=None, language='', replace=False)

Set a parameter in the Content-Type header. If the parameter already exists in the header, its value will be replaced with value. If the Content-Type header as not yet been defined for this message, it will be set to text/plain and the new parameter value will be appended as per RFC 2045.

Optional header specifies an alternative header to Content-Type, and all parameters will be quoted as necessary unless optional requote is False (the default is True).

If optional charset is specified, the parameter will be encoded according to RFC 2231. Optional language specifies the RFC 2231 language, defaulting to the empty string. Both charset and language should be strings.

If replace is False (the default) the header is moved to the end of the list of headers. If replace is True, the header will be updated in place.

Changed in version 3.4: replace keyword was added.

doc_python
2016-10-07 17:32:44
Comments
Leave a Comment

Please login to continue.