gws.plugin.email_helper

Email sending helper.

Source code: gws.plugin.email_helper

Package Contents

class gws.plugin.email_helper.Config(*args, **kwargs)

Bases: gws.Config

Mail helper settings

mailFrom: str = ''

Default ‘From’ address.

smtp: SmtpConfig

SMTP server configuration.

exception gws.plugin.email_helper.Error

Bases: gws.Error

Generic GWS error.

class gws.plugin.email_helper.Message(*args, **kwargs)

Bases: gws.Data

Email message.

bcc: str

Bcc addresses.

html: str

HTML content.

mailFrom: str

From address (default if omitted).

mailTo: str

To addresses, comma separated.

subject: str

Subject.

text: str

Plain text content.

class gws.plugin.email_helper.Object

Bases: gws.Node

GWS object tree node.

mailFrom: str
smtp: _SmtpServer
configure()

Configuration hook.

send_mail(m: Message)
class gws.plugin.email_helper.SmtpConfig(*args, **kwargs)

Bases: gws.Config

SMTP server configuration. (added in 8.1)

host: str

SMTP host name

login: str = ''

Login

mode: SmtpMode

Connection mode.

password: str = ''

Password.

port: int = 0

SMTP port.

timeout: gws.Duration = '30'

Connection timeout.

class gws.plugin.email_helper.SmtpMode(*args, **kwds)

Bases: gws.Enum

SMTP connection modes.

plain = 'plain'

Plain connection without encryption.

ssl = 'ssl'

SSL connection.

tls = 'tls'

TLS connection (STARTTLS).