python - 为什么我会收到 smtplib.SMTPRecipientsRefused: 错误?
问题描述
所以基本上我正在尝试开发一个 python 程序,它可以让我在不登录的情况下向我朋友的电子邮件发送电子邮件。但是我收到一个错误,上面写着smtplib.SMTPRecipientsRefused
:
这是我的代码..
import smtplib
myemail = 'myemail@gmail.com'
mypassword = 'password'
friendemail = input('Please enter the email of the person:')
with smtplib.SMTP("smtp.gmail.com", 587) as smtp:
subject = input("Subject: ")
body = input('Message:')
msg = f"subject:{subject}\n\n{body}"
smtp.starttls()
smtp.login(myemail,mypassword)
smtp.sendmail(myemail, mypassword, msg)
如果有人可以提供帮助,那就太好了!谢谢你!
解决方案
推荐阅读
- apache-spark - 加入RDD并获得最小值
- python - Python networkx 用松散节点连接子图
- python - Django视图多次调用函数
- c# - 如何使用参数数组做服务 WCF REST
- elasticsearch - Kafka Elasticsearch 连接器时间戳
- python-3.x - 在 docker 上设置 django
- vue.js - 避免重新渲染后滚动到顶部
- python - Celery:为什么从接受任务到开始执行任务有几秒钟的时间间隔?
- php - 如何为使用自定义函数实例化的类添加自动完成功能?
- spring - 结合OAuth2和http基本认证spring security