I have been using the following code without any issued for a year or so:
subject = "subject" email = \'to_email\' emsg = MIMEMultipart(\'alternativ