title: How to send UNICODE message in smtplib in python
body: <p>Is it possible to convert the message to unicode? Because it gives error</p>
  
  <blockquote>
    <p>_fix_eols(msg).encode('ascii') UnicodeEncodeError: 'ascii' codec can't encode characters in position 105-107: ordinal not in range(128)</p>
  </blockquote>
  
  <pre><code>fromaddrs = tkinter.StringVar()
  password = tkinter.StringVar()
  toaddrs = tkinter.StringVar()
  subject = tkinter.StringVar()
  message = tkinter.StringVar()
  
  entry_from_address = ttk.Entry(window, textvariable=fromaddrs)
  entry_from_password = ttk.Entry(window, textvariable=password)
  entry_to_address = ttk.Entry(window, textvariable=toaddrs)
  entry_subject = ttk.Entry(window, textvariable=subject)
  entry_message = ttk.Entry(window, textvariable=message)
  
  
  
  def email_send(*args):
      mail_details= """From: %s\nTo: %s\nSubject: %s\n\n%s
      """ % (fromaddrs.get(), ", ".join(toaddrs.get()), subject.get(), message.get())
      server = smtplib.SMTP('smtp.gmail.com', 587)
      server.starttls()
      server.login(fromaddrs.get(), password.get())
      server.sendmail(fromaddrs.get(), toaddrs.get(), mail_details)
      server.quit()
      print("message send")
  </code></pre>