Die Dokumentation ab Version 39.5.17 von PLANTA project finden Sie in der neuen PLANTA Online-Hilfe.

send_email

The send_email module provides classes for sending emails from Jython.

  • The code sets the charset of the mail to utf-8 automatically when non-ascii characters are detected.

Classes

_Email

Base class that all other classes inherit from.

Methods

Function Parameters Return Value Description
_Email.send(self)     Sends the email using the SMTP server configured in smtp_server_adress

SimpleEmail

Methods

Function Parameters Return Value Description
SimpleEmail.__init__(self, subject, from_address, recipients, message_text) subject: The subject of the email
from_address: The adress the email should appear to be sent from
recipients: A list of email addresses of all recipients
message_text: A plain text message
SimpleEmail instance Initialize a new SimpleEmail object

HtmlEmail

Methods

Function Parameters Return Value Description
HtmlEmail.__init__(self, subject, from_address, recipients, html_content, plain_text_content='') subject: The subject of the email
from_address: The adress the email should appear to be sent from
recipients: A list of email addresses of all recipients
html_content: The HTML content of the message

plain_text_content: A plain text fallback to send with the email
HtmlEmail instance Initialize a new HtmlEmail object

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()

         PLANTA project









 
  • Suche in Topic-Namen

  • Suche in Topic-Inhalten
This site is powered by the TWiki collaboration platform Powered by Perl