Basic implementaion of SMTP client using TCP communication with the SMTP server using the socket
module.
pip install sandesh.py
from sandesh_py import smtp
auth: smtp.SMTPAuth = {
"username": YOUR_SMTP_USERNAME,
"password": YOUR_SMTP_PASSWORD,
}
options: smtp.SMTPOptions = {"notls": False}
client = smtp.SMTPClient(SMTP_SERVER_HOST, SMTP_PORT, auth, options)
client.connect()
mail = smtp.Mail(
{
"mailTo": "[email protected]",
"mailFrom": "[email protected]",
"subject": "Mail subject",
"body": "This is demonstartaion of use of sandesh_py package",
"attachment": [
"/path/to/attachment/1",
"/path/to/attachment/2",
],
}
)
print(client.sendMail(mail))
client.close()
- Add support for MIME to handle attachments and alternative content types
- Support Oath and API authentication
- Connection Pooling and Asynchronous Delivery