def make_message_multipart(message):
if not message.is_multipart():<EOL><INDENT>multipart_message = email.mime.multipart.MIMEMultipart('<STR_LIT>')<EOL>for header_key in set(message.keys()):<EOL><INDENT>values = message.get_all(header_key, failobj=[])<EOL>for value in values:<EOL><INDENT>multipart_message[header_key] = value<EOL><DEDENT><DEDENT>original_text = message.get_payload()<EOL>multipart_message.attach(email.mime.text.MIMEText(original_text))<EOL>message = multipart_message<EOL><DEDENT>message = _create_boundary(message)<EOL>return message<EOL>
Convert a message into a multipart message.