Beyond Mail its an open source project made for sending emails easily with python.
Project description
Beyond Mail
Beyond Mail its an open source project made for sending emails easily with python.
import os
from beyondmail import BeyondMail, Host
# Getting Credentials from Env Variables
my_email = os.get('EMAIL')
password = os.get('PASSWORD')
# Sending Email
with BeyondMail(my_email, password, Host.GMAIL) as mail_client:
mail_client.send_email(['email@exemple.com'], 'Subject', 'Content')
Documentation
BeyondMail
BeyondMail
is the main class of the lib, when you create an instance of this class, you can "login" in the SMTP Server and then, send your emails.
If you try send email without login, an error will be thrown.
import os
from beyondmail import BeyondMail, Host
# Getting Credentials from Env Variables
my_email = os.get('EMAIL')
password = os.get('PASSWORD')
# Sending Email
mail_client = BeyondMail(my_email, password, Host.GMAIL)
mail_client.login()
mail_client.send_email(['email@exemple.com'], 'Subject', 'Content')
mail_client.logout()
You can also use python context api
(with) to sending your emails like the first exemple, when you use the context api the instance calls the login()
and logout()
methods by yourself.
Hosts
For use one email server, its just get the constant in Host
class.
OBS: The hosting support are in progress, if you want to colaborate to our project, please make a pull request.
- Gmail
- You need to generate an App Password of google to use.
- Outlook
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file beyondmail-0.1.4.tar.gz
.
File metadata
- Download URL: beyondmail-0.1.4.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a39e6324c648fd62400369304b45d94c63d8932bd83a5ca527b68b4b7ac83b6c |
|
MD5 | 424c5dc5b102482233ae483f858c8704 |
|
BLAKE2b-256 | 3aa86bba5aa875b4768c7cb8cafe64065a962dcde14b3d904f8615d62493a3dc |
File details
Details for the file beyondmail-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: beyondmail-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.15.133.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 581d3ac5703671ad423a17b8113f790d031f24ac25c244fc5530ca36515c446a |
|
MD5 | db16078d359dd78e2da856bce27d8712 |
|
BLAKE2b-256 | f89a961c2b51e12c95cc5f42af06b8b4da27f9097a13df08f2b74e23e6bba5d4 |