reddit_bot.py
def create_email_message(from_address, to_address, subject, body):
    """Create a EmailMessage object for sending emails.
    
    Params:
    -------
    from_address: string
        a sending email address
    to_address: list of string
        a list of receiving email addresses
    subject: string
        email subject
    body: string
        email body
    
    Return:
    -------
    msg: EmailMessage
        a email message ready to send via smtp
    """
    
    msg = EmailMessage()
    msg['From'] = from_address
    msg['To'] = to_address
    msg['Subject'] = subject
    
    msg.add_alternative(body, subtype='html')
    
    with open('logo.png', 'rb') as img:
        msg.get_payload()[0].add_related(img.read(), 'image', 'jpeg', cid='logo')

    return msg
Create a EmailMessage object for sending emails.
    
    Params:
    -------
    from_address: string
        a sending email address
    to_address: list of string
        a list of receiving email addresses
    subject: string
        email subject
    body: string
        email body
    
    Return:
    -------
    msg: EmailMessage
        a email message ready to send via smtp
    
Create a EmailMessage object for sending emails.
Params.

string
a sending email address
to_address: list of string
a list of receiving email addresses
subject: string
email subject
body: string
email body



EmailMessage
a email message ready to send via smtp
Create a EmailMessage object for sending emails . Params . string a sending email address to_address : list of string a list of receiving email addresses subject : string email subject body : string email body EmailMessage a email message ready to send via smtp
def create_email_message(from_address, to_address, subject, body):
    msg = EmailMessage()
    msg['From'] = from_address
    msg['To'] = to_address
    msg['Subject'] = subject
    msg.add_alternative(body, subtype='html')
    with open('logo.png', 'rb') as img:
        msg.get_payload()[0].add_related(img.read(), 'image', 'jpeg', cid='logo')
    return msg
def create_email_message ( from_address , to_address , subject , body ) : msg = EmailMessage ( ) msg [ 'From' ] = from_address msg [ 'To' ] = to_address msg [ 'Subject' ] = subject msg . add_alternative ( body , subtype = 'html' ) with open ( 'logo.png' , 'rb' ) as img : msg . get_payload ( ) [ 0 ] . add_related ( img . read ( ) , 'image' , 'jpeg' , cid = 'logo' ) return msg
Create a EmailMessage object for sending emails.
Create a EmailMessage object for sending emails .
"""Create a EmailMessage object for sending emails.
    
    Params:
    -------
    from_address: string
        a sending email address
    to_address: list of string
        a list of receiving email addresses
    subject: string
        email subject
    body: string
        email body
    
    Return:
    -------
    msg: EmailMessage
        a email message ready to send via smtp
    """
from_address
to_address
subject
body