Source code for kabbes_gmail.Email

from parent_class import ParentClass
import py_starter as ps

[docs]class Email( ParentClass ): DEFAULT_KWARGS = { 'to': None, 'subject': None, 'content': [] } def __init__( self, conn, **kwargs ): ParentClass.__init__( self ) self.conn = conn joined_kwargs = ps.merge_dicts( Email.DEFAULT_KWARGS, kwargs ) self.set_atts( joined_kwargs )
[docs] def send( self, print_off: bool = True ): if print_off: print ('Sending email to ' + str(self.to)) try: self.conn.conn.send( self.to, self.subject, self.content ) except: return False return True