emaillib package¶
Submodules¶
emaillib.emaillib module¶
Main module file
-
class
emaillib.emaillib.EasySender(address, username=None, password=None, tls=False, ssl=True)[source]¶ Bases:
objectA simple wrapper around the SmtpServer object
-
send(sender, recipients, cc=None, bcc=None, subject='', body='', attachments=None, content='text')[source]¶ Sends the email by connecting and disconnecting after the send
Parameters: - sender – The sender of the message
- recipients – The recipients (To:) of the message
- cc – The CC recipients of the message
- bcc – The BCC recipients of the message
- subject – The subject of the message
- body – The body of the message
- attachments – The attachments of the message
- content – The type of content the message [text/html]
Returns: True on success, False otherwise
-
-
class
emaillib.emaillib.Message(sender, recipients, cc=None, bcc=None, subject='', body='', attachments=None, content='text')[source]¶ Bases:
objectA model of an email message
-
as_string¶ The string representation of the message
-
attachments¶ A list of attachment names of the message
-
bcc¶ The bcc recipients of the message
-
body¶ The body of the message
-
cc¶ The cc recipients of the message
-
content¶ The type of content of the message
-
recipients¶ A list of all recipients of the message
-
sender¶ The email address of the sender
-
subject¶ The subject of the message
-
to¶ The main (to) recipients of the message
-
-
class
emaillib.emaillib.SmtpServer(address, username=None, password=None, tls=True, ssl=False, port=None)[source]¶ Bases:
objectA simple wrapper around build in smtplib capabilities
-
address¶ The smtp server address upon instantiation
-
connect()[source]¶ Initializes a connection to the smtp server
Returns: True on success, False otherwise
-
connected¶ The status of connection to the smtp server
-
disconnect()[source]¶ Disconnects from the remote smtp server
Returns: True on success, False otherwise
-
password¶ The password upon instantiation
-
port¶ The smtp server port upon instantiation
-
send(sender, recipients, cc=None, bcc=None, subject='', body='', attachments=None, content='text')[source]¶ Sends the email
Parameters: - sender – The server of the message
- recipients – The recipients (To:) of the message
- cc – The CC recipients of the message
- bcc – The BCC recipients of the message
- subject – The subject of the message
- body – The body of the message
- attachments – The attachments of the message
- content – The type of content the message [text/html]
Returns: True on success, False otherwise
-
ssl¶ The setting of ssl upon instantiation
-
tls¶ The setting of tls upon instantiation
-
username¶ The username upon instantiation
-