'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 must be specified as a
three-tuple of (charset, language, value), in which case it will be
encoded according to RFC2231 rules.
Example:
msg.add_header(\'content-disposition\', \'attachment\', filename=\'bud.gif\')'

def add_header(self, _name, _value, **_params):

    parts = []
    for (k, v) in _params.items():
        if (v is None):
            parts.append(k.replace('_', '-'))
        else:
            parts.append(_formatparam(k.replace('_', '-'), v))
    if (_value is not None):
        parts.insert(0, _value)
    self._headers.append((_name, SEMISPACE.join(parts)))
