title: How do I send an e-mail with some non-ASCII characters in Python?
body: <p>I am using Python 3.7 and trying to send e-mails with smtplib. My script works flawlessly so long as the message doesn't contain any Turkish characters such as "ş,ı,İ,ç,ö". The only solution I have found so far that works is using the <code>"string=string.encode('ascii', 'ignore').decode('ascii')"</code> line but when I do that, the string "<code>İşlem tamamlanmıştır."</code> becomes <code>"lem tamamlanmtr."</code>.
  So how can I keep the original string and bypass this error?</p>
  
  <p>The relevant part of the code:</p>
  
  <pre><code>import smtplib
  server = smtplib.SMTP_SSL(r'smtp.gmail.com', 465)
  server.ehlo()
  server.login(gmail_user, gmail_password)
  message = 'Subject: {}\n\n{}'.format(subject, text)
  server.sendmail(from, to, message)
  server.close()
  </code></pre>