utilities - send_email
The send_email module provides classes for sending emails from Jython.
The code automatically sets the charset of the mail to utf-8 when non-ascii characters are detected.
Classes
_Email
Base class that all other classes inherit from.
Methods
Function | Parameters | Return Value | Description |
|---|---|---|---|
_Email.send | Sends the email using the SMTP server configured in smtp_server_adress |
SimpleEmail
Methods
Function | Parameters | Return Value | Description |
|---|---|---|---|
SimpleEmail.__init__ | subject: subject of the email |
| Initializes a new |
HtmlEmail
Methods
Function | Parameters | Return Value | Description |
|---|---|---|---|
HtmlEmail.__init__ | subject: subject of the email |
| Initializes a new |
Examples
Sending a plain text email
from customizing import utilities
message_text = u'''This is an example message text!
It contains multiple lines!
And even some non ascii characters! Ä Ö Ü'''
email = utilities.SimpleEmail(subject='Example email',
from_address='you@yourcompany.com',
recipients=['someone@yourcompany.com'],
message_text=message_text)
email.send()