Comments (6)
server = smtplib.SMTP(Config().EMAIL_SERVER_HOST)
server.login(Config().EMAIL_SERVER_USER, Config().EMAIL_SERVER_PASSWORD)
server.ehlo() # 添加这个
server.starttls() # 添加这个 ./py12306/helpers/notification.py
server.send_message(message)
server.quit()
CommonLog.add_quick_log(CommonLog.MESSAGE_SEND_EMAIL_SUCCESS).flush()```
from py12306.
我添加了行代码。邮件配置这样子
# 邮箱配置
EMAIL_ENABLED = 1 # 是否开启邮件通知
EMAIL_SENDER = '[email protected]' # 邮件发送者
# 邮件接受者 # 可以多个 [[email protected], [email protected]]
EMAIL_RECEIVER = '[email protected]'
EMAIL_SERVER_HOST = 'smtp.163.com' # 邮件服务 host
EMAIL_SERVER_USER = '[email protected]'
EMAIL_SERVER_PASSWORD = '你的授权码 qq或者网易邮箱等的'
from py12306.
邮箱配置中 host 支持带端口,如 smtp.qq.com:465
,再试试
from py12306.
邮件发送使用ssl会失败,建议增加一个参数,判断是否使用ssl
我改了下源码,./py12306/helpers/notification.py:91行,使用smtplib.SMTP_SSL调用ssl进行邮件发送
from py12306.
好的,感谢
from py12306.
授权码是登录发送邮箱的密码?
from py12306.
Related Issues (20)
- ModuleNotFoundError: No module named 'requests' HOT 1
- 获取用户乘客列表失败,错误原因: [] HOT 2
- 测试获取用户乘客列表失败,错误原因: 网络错误 XX 秒后重试
- 可以提供下web的源码吗 HOT 3
- 抢票成功后程序报错 get_station_by(key, 'key') 返回 None HOT 1
- 滑块验证识别失败 HOT 7
- 为什么刷票期间,登录二维码时不时出现一下 HOT 2
- maximum recursion depth exceeded while calling a Python object HOT 10
- docker 无法登陆12306
- RuntimeError: This event loop is already running HOT 1
- 使用自己制作的镜像运行出错 HOT 1
- `requirements.txt`中的依赖存在模块冲突
- web页面无法正常打开 HOT 9
- 打码失败,求推荐新的打码平台 HOT 1
- python3.11 版本会导致 lxml 安装有问题,无法成功执行 pip install -r requirements.txt(使用 python 3.6 没有该问题) HOT 3
- 订单占位完成之后出现如下错误 HOT 4
- encryptedData参数值来源问题 HOT 2
- 项目还在维护吗 HOT 1
- 各位大佬 这个项目,现在还能用吗 时间:2023/12/7 HOT 14
- 一直在查询不下单怎么办 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py12306.