• <tfoot id='Gzj7F'></tfoot>

  • <i id='Gzj7F'><tr id='Gzj7F'><dt id='Gzj7F'><q id='Gzj7F'><span id='Gzj7F'><b id='Gzj7F'><form id='Gzj7F'><ins id='Gzj7F'></ins><ul id='Gzj7F'></ul><sub id='Gzj7F'></sub></form><legend id='Gzj7F'></legend><bdo id='Gzj7F'><pre id='Gzj7F'><center id='Gzj7F'></center></pre></bdo></b><th id='Gzj7F'></th></span></q></dt></tr></i><div id='Gzj7F'><tfoot id='Gzj7F'></tfoot><dl id='Gzj7F'><fieldset id='Gzj7F'></fieldset></dl></div>

  • <small id='Gzj7F'></small><noframes id='Gzj7F'>

    • <bdo id='Gzj7F'></bdo><ul id='Gzj7F'></ul>

      <legend id='Gzj7F'><style id='Gzj7F'><dir id='Gzj7F'><q id='Gzj7F'></q></dir></style></legend>

      1. 服务器不支持 SMTP AUTH 扩展

        SMTP AUTH extension not supported by server(服务器不支持 SMTP AUTH 扩展)

                <tbody id='FZ09v'></tbody>
                <bdo id='FZ09v'></bdo><ul id='FZ09v'></ul>
              • <legend id='FZ09v'><style id='FZ09v'><dir id='FZ09v'><q id='FZ09v'></q></dir></style></legend>

                <small id='FZ09v'></small><noframes id='FZ09v'>

              • <i id='FZ09v'><tr id='FZ09v'><dt id='FZ09v'><q id='FZ09v'><span id='FZ09v'><b id='FZ09v'><form id='FZ09v'><ins id='FZ09v'></ins><ul id='FZ09v'></ul><sub id='FZ09v'></sub></form><legend id='FZ09v'></legend><bdo id='FZ09v'><pre id='FZ09v'><center id='FZ09v'></center></pre></bdo></b><th id='FZ09v'></th></span></q></dt></tr></i><div id='FZ09v'><tfoot id='FZ09v'></tfoot><dl id='FZ09v'><fieldset id='FZ09v'></fieldset></dl></div>
                  <tfoot id='FZ09v'></tfoot>

                  本文介绍了服务器不支持 SMTP AUTH 扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  使用 python 我想从我的应用程序发送电子邮件,但它显示错误

                  Using python I want to send email from my app but it shows the error

                  SMTP AUTH extension not supported by server
                  

                  程序代码,

                  import smtplib
                  from email.MIMEMultipart import MIMEMultipart
                  from email.MIMEText import MIMEText
                  fromaddr = "test1@example.com"
                  toaddr = "test2@example.com"
                  msg = MIMEMultipart()
                  msg['From'] = fromaddr
                  msg['To'] = toaddr
                  msg['Subject'] = "Test Mail"
                  body = "Test mail from python"
                  msg.attach(MIMEText(body, 'plain'))
                  server = smtplib.SMTP('smtp.example.com', 25)
                  server.ehlo()
                  server.starttls()
                  server.ehlo()
                  server.login(fromaddr, "password")
                  text = msg.as_string()
                  server.sendmail(fromaddr, toaddr, text)
                  server.quit()
                  

                  Telnet 输出:

                  ehlo test1.example.com
                  250-hidden
                  250-HELP
                  250-SIZE 104857600
                  250-ENHANCEDSTATUSCODES
                  250-8BITMIME
                  250-STARTTLS
                  250 OK
                  

                  我需要验证并从应用发送邮件.

                  I need to authenticate and send mail from app.

                  推荐答案

                  登录和发送邮件前需要连接.

                  a connection is required before login and sendemail.

                  server = smtplib.SMTP('smtp.example.com', 25)
                  server.connect("smtp.example.com",465)
                  server.ehlo()
                  server.starttls()
                  server.ehlo()
                  server.login(fromaddr, "password")
                  text = msg.as_string()
                  server.sendmail(fromaddr, toaddr, text)
                  server.quit()
                  

                  这篇关于服务器不支持 SMTP AUTH 扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  env: python: No such file or directory(env: python: 没有这样的文件或目录)
                  How to evaluate environment variables into a string in Python?(如何在 Python 中将环境变量评估为字符串?)
                  Python - temporarily modify the current process#39;s environment(Python - 临时修改当前进程的环境)
                  Change current process environment#39;s LD_LIBRARY_PATH(更改当前进程环境的 LD_LIBRARY_PATH)
                  Reading and writing environment variables in Python?(在 Python 中读写环境变量?)
                  When to use sys.path.append and when modifying %PYTHONPATH% is enough(何时使用 sys.path.append 以及何时修改 %PYTHONPATH% 就足够了)
                  • <bdo id='oibgr'></bdo><ul id='oibgr'></ul>

                      <small id='oibgr'></small><noframes id='oibgr'>

                        <tbody id='oibgr'></tbody>

                        1. <tfoot id='oibgr'></tfoot>
                          <i id='oibgr'><tr id='oibgr'><dt id='oibgr'><q id='oibgr'><span id='oibgr'><b id='oibgr'><form id='oibgr'><ins id='oibgr'></ins><ul id='oibgr'></ul><sub id='oibgr'></sub></form><legend id='oibgr'></legend><bdo id='oibgr'><pre id='oibgr'><center id='oibgr'></center></pre></bdo></b><th id='oibgr'></th></span></q></dt></tr></i><div id='oibgr'><tfoot id='oibgr'></tfoot><dl id='oibgr'><fieldset id='oibgr'></fieldset></dl></div>
                          <legend id='oibgr'><style id='oibgr'><dir id='oibgr'><q id='oibgr'></q></dir></style></legend>