1 Star 0 Fork 0

work-ji-python/yagmail

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
README.rst 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
Volcyy 提交于 2017-10-14 19:56 +08:00 . Add examples & link to documentation in README.rst.

yagmail - Yet another GMAIL / SMTP client

yagmail is a GMAIL/SMTP client that aims to make it as simple as possible to send emails.

Sending an Email is as simple:

import yagmail
yag = yagmail.SMTP()
contents = [
    "This is the body, and here is just text http://somedomain/image.png",
    "You can find an audio file attached.", '/local/path/to/song.mp3'
]
yag.send('[email protected]', 'subject', contents)

# Alternatively, with a simple one-liner:
yagmail.SMTP('mygmailusername').send('[email protected]', 'subject', contents)

Note that yagmail will read the password securely from your keyring, see the section on Username and Password in the repository's README for further details. If you do not want this, you can initialize yagmail.SMTP like this:

yag = yagmail.SMTP('mygmailusername', 'mygmailpassword')

but honestly, do you want to have your password written in your script?

For further documentation and examples, please go to https://github.com/kootenpv/yagmail.

The full documentation is available at http://yagmail.readthedocs.io/en/latest/.

Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/work-ji-python/yagmail.git
[email protected]:work-ji-python/yagmail.git
work-ji-python
yagmail
yagmail
master

搜索帮助