Emails utils

The email_utils module is used to create and send emails. It uses smtplib to send an email.

class email_utils.Email(from_, to, cc, subject, message, attachments, signature)

Bases : object

Manage emails.

static get_name_from_address(address)

Return the name associated to the address.

static add_name_to_signature(signature, name, color='#263068')

Add the name to the signature.

class email_utils.EmailConnection(username, password, server='smtps.upmc.fr', port=587)

Bases : object

Manage communication with the SMTP server.

connect()

Connect to the server.

static is_valid(username, password, server='smtps.upmc.fr', port=587)

Return True if the username and the password are valid.

static get_list(addresses)

Return a list of addresses from a string.

send(message)

Send an email.

close()

Close connection.