A Python module for sending emails with Hectane.
Installing pyhectane is as simple as:
pip install pyhectane
Accessing the Hectane API with pyhectane centers around the Connection
object. The example below demonstrates the process of creating an instance and using it to send a simple email:
import pyhectane
c = pyhectane.Connection()
c.send(
from_='me@me.com',
to=['you@you.com'],
subject="Email Subject",
text="Email body.",
attachments=[
'somefile.zip',
'otherfile.tar.gz',
],
)
For projects using the Django framework, an email backend for Hectane is available. To use the backend, add the following line to settings.py
:
EMAIL_BACKEND = 'pyhectane.django.HectaneBackend'
The following settings are also recognized:
HECTANE_HOST
HECTANE_PORT
HECTANE_TLS
HECTANE_USERNAME
HECTANE_PASSWORD