PyDocs

Nav

Internet Data Handling

EmailMessage.add_header

  • EmailMessage.add_header(_name, _value, **_params)
Extended header setting.

name is the header field to add.  keyword arguments can be used to set
additional parameters for the header field, with underscores converted
to dashes.  Normally the parameter will be added as key="value" unless
value is None, in which case only the key will be added.  If a
parameter value contains non-ASCII characters it can be specified as a
three-tuple of (charset, language, value), in which case it will be
encoded according to RFC2231 rules.  Otherwise it will be encoded using
the utf-8 charset and a language of ''.

Examples:

msg.add_header('content-disposition', 'attachment', filename='bud.gif')
msg.add_header('content-disposition', 'attachment',
               filename=('utf-8', '', 'Fußballer.ppt'))
msg.add_header('content-disposition', 'attachment',
               filename='Fußballer.ppt'))
0 Examples
No examples for email.message/EmailMessage.add_header.
See Also
No see-alsos for email.message/EmailMessage.add_header
0 Notes
No notes for EmailMessage.add_header