Sending emails in python just became much easier
Project description
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
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
send_mail-0.0.2.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for send_mail-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d647f33467495d5bcfcb2facbbaec58629207a53b0ca9cdd2b48b54b01a02e93 |
|
MD5 | ac8ef94726cb13b02ba6024894831e1b |
|
BLAKE2b-256 | 55e24c4c23e637f03c60f6815c077b2fe640b0771cb0a9ca45f79eccb4b47187 |