Install the package from Pypi:
pip install redmail
Or install the package using Conda:
conda install -c conda-forge redmail
You can configure your sender by:
from redmail import EmailSender email = EmailSender( host='<SMTP HOST>', port='<SMTP PORT>', username='<USERNAME>', password='<PASSWORD>' )
# Or if your SMTP server does not require credentials email = EmailSender( host='<SMTP HOST>', port='<SMTP PORT>', )
The correct SMTP port is typically 587.
There are guides to set up the following email providers:
By default, Red Mail uses STARTTLS as the protocol. This is suitable for majority of cases but if you need to use SSL, TLS or other protocols, see Configuring SMTP Client.
You can just send emails by calling the method
email.send( subject='email subject', sender="firstname.lastname@example.org", receivers=['email@example.com'], text="Hi, this is an email." )
Next tutorial covers sending emails more thoroughly.