python通过SMTP发送邮件失败,报错505/535

python通过SMTP发送邮件失败:
错误1:smtplib.SMTPAuthenticationError: (550, b‘User has no permission‘)
    我们使用python发送邮件时相当于自定义客户端根据用户名和密码登录,然后使用SMTP服务发送邮件,新注册的163邮箱是默认不开启客户端授权的(对指定的邮箱大师客户端默认开启),因此登录总是被拒绝,解决办法(以163邮箱为例):进入163邮箱-设置-客户端授权密码-开启(授权码是用于登录第三方邮件客户端的专用密码)
错误2:smtplib.SMTPAuthenticationError: (535, b‘Error: authentication failed‘)
  以163邮箱为例,在开启POP3/SMTP服务,并开启客户端授权密码时会设置授权码,将这个授权码代替smtplib.SMTP().login(user,password)方法中的password即可。

时间: 2024-08-06 11:02:19

python通过SMTP发送邮件失败,报错505/535的相关文章

python 读取数据库,老是报错。

在8.04.4环境下(其实我觉得跟环境无关,是我语句有问题): $ dpkg -l | grep -i python ii  libapache2-mod-python                 3.3.1-2build1               Apache 2 module that embeds Python within th ii  moinmoin-common                       1.5.8-5.1ubuntu2.5          Python

python安装模块的时候报错error: command 'gcc' failed with exit status 1

[情况] 在写Python代码的时候,需要用到psutil模块,需要安装. 但是在安装时,报错:error: command 'gcc' failed with exit status 1 [解决步骤] 按照经验,觉得应该是缺少了gcc模块, 所以操作 [ yum install -y gcc ] 安装完成后,再继续安装psutil还是报同样的错,发现报错不是  not found gcc,可能是某个功能模块缺失 发现需要安装多一些依赖的包:  [ yum install -y libffi-d

Windows Essentials Movie Maker 安装失败报错 ——问题解决

Windows Essentials Movie Maker 安装失败报错: (软件包名: wlsetup-all.exe) 查到官方论坛给出了一些回复: https://social.technet.microsoft.com/Forums/windows/en-US/583637d8-434d-4fb6-9abd-b86820cd96dc/unable-to-install-windows-live-2012-into-windows-10-amp-windows-81error0x800c

refiling失败报错Invalid function: org-preserve-local-variables

refiling失败报错Invalid function: org-preserve-local-variables,原因: elc,不太清楚 解决办法: 删除org??目录下的elc文件 https://github.com/syl20bnr/spacemacs/issues/11801 https://emacs-china.org/t/spacemacs-org-mode-org-refile/8157 在github上已经有了相关的Issue, #11788 #11801 解决方案如下:

Python读取CSV文件,报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 727: illegal multibyte sequence

Python读取CSV文件,报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 727: illegal multibyte sequence 解决办法: 在语句open(sFileName,newline='')中,增加encoding='UTF-8',如下: open(sFileName,newline='',encoding='UTF-8') Python读取CSV文件,报错:UnicodeDecode

关于socket模块获取ip失败报错

问题:socket模块获取ip失败报错 In [64]: import socket In [71]: socket.gethostname() Out[71]: 'web01' In [72]: host_name = socket.gethostname() In [73]: socket.gethostbyname(host_name) --------------------------------------------------------------------------- g

解决《利用python进行数据分析》P139报错问题 index must be monotonic increasing or decreasing

解决<利用python进行数据分析>P139报错问题 index must be monotonic increasing or decreasingframe.reindex(index=['a','b','c','d'],method='ffill',columns=states)报错:index must be monotonic increasing or decreasing 修改代码:把method=‘ffill’拿出来注意,是method的方法,参数ffill后面加"(

解压版本Python,手动安装pip报错,pip得到报错&quot; No module named &#39;pip&#39; &quot;

解压版本Python,手动安装pip报错 λ pip Traceback (most recent call last): File "runpy.py", line 193, in _run_module_as_main File "runpy.py", line 86, in _run_code File "D:\tools\python-3.8.1-embed-amd64\Scripts\pip.exe\__main__.py", line

发送邮件程序报错454 Authentication failed以及POP3和SMTP简介

一.发现问题 在测试邮件发送程序的时候,发送给自己的QQ邮箱,程序报错454 Authentication failed, please open smtp flag first. 二.解决问题 进入QQ邮箱-->设置-->账户-->POP3/IMAP/SMTP选择-->开启POP3/SMTP服务. 三.POP3和SMTP是什么 1.基本概念一般每个提供电子邮件服务的网站都有自己的SMTP和POP服务器地址.POP(Post Office Protocol)邮局通讯协定,POP是互