title: Airflow SMTP AUTH extension not supported by server
body: <p>Using Airflow 2.0.1 with the following <code>airflow.cfg</code> configuration. I am trying to send an email notification. My gmail account 2-factor-authentication activated.</p>
  <pre><code>smtp_host = smtp.gmail.com
  smtp_starttls = False
  smtp_ssl = False
  smtp_user = &lt;my_gmail_user@gmail.com&gt;
  smtp_password = &lt;my_password&gt;
  smtp_port = 587
  smtp_mail_from = &lt;my_gmail_user@gmail.com&gt;
  smtp_timeout = 30
  smtp_retry_limit = 5
  </code></pre>
  <p>My e-mail task</p>
  <pre><code>send_email_notification = EmailOperator(
          task_id='send_email_notification',
          to='&lt;my_another_working_email&gt;@hotmail.com',
          subject='Airflow mail test',
          html_content=&quot;&lt;h3&gt; Airflow mail test&lt;/h2&gt;&quot;
      )
  </code></pre>
  <p>But I got the following error. During the airflow installation, I specified <code>admin@vbo.local</code> as admin user mail which actually doesn't exist. I am not sure it is the reason for the error.</p>
  <pre><code>ERROR - SMTP AUTH extension not supported by server.
  Traceback (most recent call last):
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1112, in _run_raw_task
      self._prepare_and_execute_task_with_callbacks(context, task)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1285, in _prepare_and_execute_task_with_callbacks
      result = self._execute_task(context, task_copy)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1315, in _execute_task
      result = task_copy.execute(context=context)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/operators/email.py&quot;, line 87, in execute
      mime_charset=self.mime_charset,
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 62, in send_email
      **kwargs,
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 97, in send_email_smtp
      send_mime_email(e_from=smtp_mail_from, e_to=recipients, mime_msg=msg, dryrun=dryrun)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 195, in send_mime_email
      conn.login(smtp_user, smtp_password)
    File &quot;/usr/lib64/python3.6/smtplib.py&quot;, line 697, in login
      &quot;SMTP AUTH extension not supported by server.&quot;)
  smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.
  [2021-05-20 16:04:49,885] {taskinstance.py:1503} INFO - Marking task as FAILED. dag_id=my_data_pipeline, task_id=send_email_notification, execution_date=20210520T125758, start_date=20210520T130449, end_date=20210520T130449
  [2021-05-20 16:04:49,914] {email.py:184} INFO - Email alerting: attempt 1
  [2021-05-20 16:04:50,227] {email.py:184} INFO - Email alerting: attempt 1
  [2021-05-20 16:04:50,484] {taskinstance.py:1509} ERROR - Failed to send email to: admin@vbo.local
  [2021-05-20 16:04:50,484] {taskinstance.py:1510} ERROR - SMTP AUTH extension not supported by server.
  Traceback (most recent call last):
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1112, in _run_raw_task
      self._prepare_and_execute_task_with_callbacks(context, task)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1285, in _prepare_and_execute_task_with_callbacks
      result = self._execute_task(context, task_copy)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1315, in _execute_task
      result = task_copy.execute(context=context)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/operators/email.py&quot;, line 87, in execute
      mime_charset=self.mime_charset,
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 62, in send_email
      **kwargs,
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 97, in send_email_smtp
      send_mime_email(e_from=smtp_mail_from, e_to=recipients, mime_msg=msg, dryrun=dryrun)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 195, in send_mime_email
      conn.login(smtp_user, smtp_password)
    File &quot;/usr/lib64/python3.6/smtplib.py&quot;, line 697, in login
      &quot;SMTP AUTH extension not supported by server.&quot;)
  smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1852, in email_alert
      send_email(self.task.email, subject, html_content)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 62, in send_email
      **kwargs,
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 97, in send_email_smtp
      send_mime_email(e_from=smtp_mail_from, e_to=recipients, mime_msg=msg, dryrun=dryrun)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 195, in send_mime_email
      conn.login(smtp_user, smtp_password)
    File &quot;/usr/lib64/python3.6/smtplib.py&quot;, line 697, in login
      &quot;SMTP AUTH extension not supported by server.&quot;)
  smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1507, in handle_failure
      self.email_alert(error)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/models/taskinstance.py&quot;, line 1854, in email_alert
      send_email(self.task.email, subject, html_content_err)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 62, in send_email
      **kwargs,
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 97, in send_email_smtp
      send_mime_email(e_from=smtp_mail_from, e_to=recipients, mime_msg=msg, dryrun=dryrun)
    File &quot;/home/train/venvairflow/lib/python3.6/site-packages/airflow/utils/email.py&quot;, line 195, in send_mime_email
      conn.login(smtp_user, smtp_password)
    File &quot;/usr/lib64/python3.6/smtplib.py&quot;, line 697, in login
      &quot;SMTP AUTH extension not supported by server.&quot;)
  smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.
  [2021-05-20 16:04:50,538] {local_task_job.py:146} INFO - Task exited with return code 1
  </code></pre>