Powered by Tachyonic Project Luxon Framework v0.0.0

Luxon Framework for rapid application development. (luxon)

Version

Email Service

Send Mail

luxon.helpers.sendmail.sendmail(email, rcpt=None, subject=None, body=None, msg=None, fail_callback=None, success_callback=None)[source]

Helper function to send an email.

SMTP server settings are obtained from settings.ini file. E.g:

[smtp]
host = 127.0.0.1
port = 587
tls = False
username = None
password = None
Parameters:
  • email (str) – Sender email address.
  • rcpt (str) – Recipient email address.
  • subject (str) – Email Subject.
  • body (str) – Email Body
  • msg (obj) – object of python email library’s EmailMessage class.
  • fail_callback (func) – Function to call on send failure.
  • success_callback (func) – Function to call on send success.
Returns:

True if sending was successful, else False.

Return type:

Bool

Email Utilities