Email_Sender is Python Package For Sending Email Easily. This package is trying to help programmer save time adjusting code for sending email.
you should have python 3
$ pip3 install py-send-e-mail
email_sender have one base class Mail that used to send email using smtp connection.
Parameters
- email - Required - Email of sender. once you initiate it, it can be used for sending emails
- password - Required if envPath is None
- Password is required if you don't specify the
.env
path - in Most case programmer don't wanna put password as string inside their code for that email_sender module use dotenv. - host - default to 'smtp.gmail.com'
- port - default to 587
- envPath - optional
- envPath expect
python pathlib.Path('.env file location').resolve()
- envName - optional default to
password
- envName if the name of the password in the.env
is another name.
from email_sender.mail import Mail
from pathlib import Path
senderEmail = 'sender@gmail.com
receiverEmail = 'receiverEmail@gmail.com'
mail = Mail(senderEmail, envPath=Path('.env'), envName='cha')
message = '''\
Subject: Testing Emails
This is testing email message
'''
mail.send_email(receiverEmail, message)
if you want to clone and use the repo use the requirement.txt file
pip3 install -r requirements.txt
My Name is Temking Mengistu . I am Student at Adama Science and Technology University in field of Computer Science and Engineering. Follow me on