internet data handling and encoding attach(payloadadds an attachment to multipart message payload must be another message object (for exampleemail mime text mimetextinternallypayload is appended to list that keeps track of the different parts of the message if the message is not multipart messageuse set_payload(to set the body of message to simple string del_param(param [header [requote]]deletes the parameter param from header header for exampleif message has the header 'foobarspam="major"'del_param('spam','foo'would delete the 'spam="major"portion of the header if requote is true (the default)all remaining values are quoted when the header is rewritten if header is omittedthe operation is applied to the 'content-typeheader replace_header(namevaluereplaces the value of the first occurrence of the header name with value value raises keyerror if the header is not found set_boundary(boundarysets the boundary parameter of message to the string boundary this string gets added as the boundary parameter to the 'content-typeheader in the message raises headerparseerror if the message has no content-type header set_charset(charsetsets the default character set used by message charset may be string such as 'iso- - or 'euc-jpsetting character set normally adds parameter to the 'content-typeheader of message (for example'content-typetext/htmlcharset="iso- - "' set_default_type(ctypesets the default message content type to ctype ctype is string containing mime type such as 'text/plainor 'message/rfc this type is not stored in the 'content-typeheader of the message set_param(paramvalue [header [requote [charset [language]]]]sets the value of header parameter param is the parameter nameand value is the parameter value header specifies the name of the header and defaults to 'content-typerequote specifies whether or not to requote all the values in the header after adding the parameter by defaultthis is true charset and language specify optional character set and language information if these are suppliedthe parameter is encoded according to rfc- this produces parameter text such as param*="'iso- - 'en-us'some% valuem set_payload(payload [charset]sets the entire message payload to payload for simple messagespayload can be byte string containing the message body for multipart messagespayload is list of message objects charset optionally specifies the character set that was used to encode the text (see set_charsetf lib fl ff