NTB WPZ Automation - EMail Downloader
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
EmailSender.EMail Class Reference

An Email Message To Be Sent Via an Email Sender. More...

Public Member Functions

def __init__ (self, from_address, to_address)
 The Constructor. More...
 
def set_from (self, address)
 Set the from address. More...
 
def set_to (self, address)
 Set the to address. More...
 
def set_subject (self, subject)
 Set the subject of the email. More...
 
def set_body (self, text)
 Set the body of the email to some text. More...
 
def set_body_html (self, html)
 Set the body of the emial to some html and package it up correctly. More...
 
def get_from (self)
 
def get_to (self)
 
def get_subject (self)
 

Static Public Member Functions

def read_template (filename)
 Returns a Template object comprising the contents of the file specified by filename. More...
 
def get_contacts (filename)
 Return two lists names, emails containing names and email addresses read from a file specified by filename. More...
 

Public Attributes

 message
 The SMTP Message object to be sent by the email sender. More...
 

Detailed Description

An Email Message To Be Sent Via an Email Sender.

Constructor & Destructor Documentation

◆ __init__()

def EmailSender.EMail.__init__ (   self,
  from_address,
  to_address 
)

The Constructor.

Parameters
from_address{string} The email address to send the email from
to_address{string} The email address to send the email to

Member Function Documentation

◆ get_contacts()

def EmailSender.EMail.get_contacts (   filename)
static

Return two lists names, emails containing names and email addresses read from a file specified by filename.

Parameters
filename{string} Path to the tempalte file to load
Returns
(names, emails) Tuple of contact names and corresponding contact emails

◆ get_from()

def EmailSender.EMail.get_from (   self)

◆ get_subject()

def EmailSender.EMail.get_subject (   self)

◆ get_to()

def EmailSender.EMail.get_to (   self)

◆ read_template()

def EmailSender.EMail.read_template (   filename)
static

Returns a Template object comprising the contents of the file specified by filename.

Parameters
filename{string} Path to the tempalte file to load
Returns
Template The template object to be used to construct emails

◆ set_body()

def EmailSender.EMail.set_body (   self,
  text 
)

Set the body of the email to some text.

Parameters
text{string} Text to set the email body to

◆ set_body_html()

def EmailSender.EMail.set_body_html (   self,
  html 
)

Set the body of the emial to some html and package it up correctly.

Parameters
html{string} String of html code to be packaged and sent as the body

◆ set_from()

def EmailSender.EMail.set_from (   self,
  address 
)

Set the from address.

Parameters
address{string} From address

◆ set_subject()

def EmailSender.EMail.set_subject (   self,
  subject 
)

Set the subject of the email.

Parameters
subject{string} The Subject

◆ set_to()

def EmailSender.EMail.set_to (   self,
  address 
)

Set the to address.

Parameters
address{string} To Address

Member Data Documentation

◆ message

EmailSender.EMail.message

The SMTP Message object to be sent by the email sender.


The documentation for this class was generated from the following file: