title: I have a problem with sending mail : TypeError: __init__() got an unexpected keyword argument 'context'
body: <p>I want to make a python script on synology NAS. Script will sent a mail when backup done. I do not know why script whose was working on windows in pycharm do not work on synology... Its problem with context=context. Its Synology NAS with instaled python and python modules. Python see all file roads but he can't sent a mail</p>
  
  <pre><code>    message = MIMEMultipart("alternative")
      message["Subject"] = "Backup zrobiony dnia: " + str(datetime.now())
      message["From"] = sender_email
      message["To"] = receiver_email
  
      # Create the plain-text and HTML version of your message
      text = """\
              Hi,
              How are you?"""
  
      def modification_date(filename):
          t = os.path.getmtime(filename)
          return datetime.fromtimestamp(t)
  
      html = """\
      &lt;html lang="PL"&gt;
      &lt;head&gt;
      &lt;style&gt;table,td,th{border:2px solid black;}&lt;/style&gt;
      &lt;/head&gt;
        &lt;body&gt;
          &lt;h1 style="text-align: center"&gt;Witam tu serwer Synology z firmy IdeaLogic&lt;/h1&gt;
             &lt;p style="text-align: center; color: #FF7B24; font-weight:bold"&gt;Backup został wykonany&lt;/p&gt;
             &lt;table style="text-align:center"&gt; 
             &lt;tr&gt;&lt;th&gt;Nr&lt;/th&gt;&lt;th&gt;Nazwa folderu&lt;/th&gt;&lt;th&gt;Data backupu&lt;/th&gt;&lt;th&gt;Czzas od ostatniego backupu&lt;/th&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;VM_DEV_JIRA_NS&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/VM_DEV_JIRA_NS'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+(str(datetime.now() - modification_date(file)))+ """&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;DB.OROOXLAB&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/DB.OROOXLAB'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/DB.OROOXLAB'))+ """&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;WinOraDB&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/WinOraDB'))+"""&lt;/td&gt;&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/WinOraDB'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;WV_DEV_REPO&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/WV_DEV_REPO'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/WV_DEV_REPO'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;VM_DEV_TOOLS&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/VM_DEV_TOOLS'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/VM_DEV_TOOLS'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;SSN_calculator&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/SSN_calculator'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/SSN_calculator'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;Firmeoo&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/Firmeoo'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/Firmeoo'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt;ISO&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/ISO'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/ISO'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;AD-VPN&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/AD-VPN'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/AD-VPN'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;GitLab&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/GitLab'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/GitLab'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;VM_DEV_JENKIS&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/VM_DEV_JENKINS'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/VM_DEV_JENKINS'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;OLD&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/OLD'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/OLD'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;tr&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;RedmineDebianOS&lt;/td&gt;&lt;td&gt;"""  +str(modification_date('/volume1/esxi_backup/RedmineDebianOS'))+"""&lt;/td&gt;"""+"""&lt;td&gt;"""+str(datetime.now() - modification_date('/volume1/esxi_backup/RedmineDebianOS'))+"""&lt;/td&gt;&lt;/tr&gt;
             &lt;/table&gt;
  
        &lt;/body&gt;
      &lt;/html&gt;"""
  
      # Turn these into plain/html MIMEText objects
      part1 = MIMEText(text, "plain")
      part2 = MIMEText(html, "html")
  
      # Add HTML/plain-text parts to MIMEMultipart message
      # The email client will try to render the last part first
      message.attach(part1)
      message.attach(part2)
  
      # Create secure connection with server and send email
      context = ssl.create_default_context()
      server = smtplib.SMTP_SSL("smtp.gmail.com", 465, context=context)
      server.login(sender_email, password)
      server.sendmail(
      sender_email, receiver_email, message.as_string()
          )
      czas = (os.stat(file)[-2])
      print('Wysłano maila')
  
  liczba_petli = int(liczba_petli)
  liczba_petli = liczba_petli + 1
  continue
  </code></pre>