# Send Mail
This package makes it much easier to send emails in python.
# Installation
Install on Linux/MacOS:
`python3 -m pip install send_mail`
Install on Windows:
`python -m pip install send_mail`
# Usage
```python
from send_mail import SendMail
# Create SendMail object
new_mail = SendMail(
# List (or string if single recipient) of the email addresses of the recipients
['recipient1@email.com', 'recipient2@email.com'],
# Subject of the email
'Email Subject',
# Body of the email
'Email Body',
# Email address of the sender
# Leave this paramter out if using environment variable 'EMAIL_ADDRESS'
'sender@email.com'
)
# Add HTML
new_mail.add_html_message('<h1>Hello, World</h1>')
# If using HTML file
# new_mail.add_html_file('/path/to/your/html/file')
# List (or string if attaching single file) of relative or absolute file path(s) to files
new_mail.attach_files(['image.jpg', 'text.txt', 'myPDF.pdf'])
# Print SendMail object to confirm email
print(new_mail)
# Send the email
# Leave this parameter out if using environment variable 'EMAIL_PASSWORD'
new_mail.send('fake_password')
```
Let me know if you would like more email services other than Gmail
PyPI 官网下载 | send_mail-0.0.1.tar.gz
版权申诉
109 浏览量
2022-01-29
21:48:15
上传
评论
收藏 4KB GZ 举报
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
最新资源
- 基于C和C++的二维绘制工具设计源码 - DrawPro
- Object.defineProperty 的 IE 补丁object-defineproperty-ie-master.zip
- 整卷预览.mhtml
- MySQL是一种广泛使用的开源关系型数据库管理系统,它提供了丰富的SQL语句用于数据库的创建、查询、更新和管理 以下是一些常见的
- MySQL是一种广泛使用的开源关系型数据库管理系统,它提供了丰富的SQL语句用于数据库的创建、查询、更新和管理 以下是一些常见
- MySQL是一种广泛使用的开源关系型数据库管理系统,它提供了丰富的SQL语句用于数据库的创建、查询、更新和管理 以下是一些常见的
- 基于Javascript的结婚请帖设计源码 - Invitation
- mysql语句大全及用法
- mysql语句大全及用法
- mysql语句大全及用法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0