Getting started
Install the package from Pypi:
pip install redengine
Configuring Email
You can configure your sender by:
from redmail import EmailSender
email = EmailSender(
host='<SMTP HOST>',
port='<SMTP PORT>',
user_name='<USER_NAME>',
password='<PASSWORD>'
)
# Or if your SMTP server does not require credentials
email = EmailSender(
host='<SMTP HOST>',
port='<SMTP PORT>',
)
Alternatively, there is a pre-configured sender for Gmail. Please see how to configure Gmail for more.
Sending Emails
You can just send emails by calling the method send:
email.send(
subject='email subject',
sender="me@example.com",
receivers=['you@example.com'],
text="Hi, this is an email."
)
Next tutorial covers sending emails more thoroughly.