or omitteda suitable boundary is determined automatically subparts is sequence of message objects that make up the contents of the message params represents optional keyword arguments and values that are added to the 'content-typeheader of the message once multipart message has been createdadditional subparts can be added using the message attach(method mimetext(data [subtype [charset]]defined in email mime text creates message containing textual data data is string containing the message payload subtype specifies the text type and is string such as 'plain(the defaultor 'htmlcharset is the character setwhich defaults to 'us-asciithe message may be encoded depending on the contents of the message the following example shows how to compose and send an email message using the classes in this sectionimport smtplib from email mime text import mimetext from email mime multipart import mimemultipart from email mime audio import mimeaudio sender "jon@nogodiggydie netreceiver"dave@dabeaz comsubject "faders up!body " never should have moved out of texas - \naudio "texasfuneral mp mimemultipart( ["to"receiver ["from"sender ["subject"subject attach(mimetext(body)apart mimeaudio(open(audio,"rb"read(),"mpeg"apart add_header("content-disposition","attachment",filename=audiom attach(apartsend the email message smtplib smtp( connect( sendmail(sender[receiver], as_string() close(notes number of advanced customization and configuration options have not been discussed readers should consult the online documentation for advanced uses of this module the email package has gone through at least four different versionswhere the underlying programming interface has been changed ( submodules renamedclasses moved to different locationsetc this section has documented version of the interface that is used in both python and python if you are working with legacy codethe basic concepts still applybut you may have to adjust the locations of classes and submodules lib fl ff