Using Python 2.7 on Windows 7 Platform.
I am trying to send email based on ID.
I currently have ID: Email set up in a dictionary to pull from. However some ID's have multiple emails associated. How would I set that up to send an email to each recipient. I've tried [ID]:[email, email], and it seems to only send to the first email address listed. Thanks in advance.
Dictionary creation code below.
COLS = ['rep_id', 'email', 'password']
with open('commissionrepemaillist.csv', 'r') as infile:
email_dict = {
row[0]: dict(zip(COLS, row)) for row in csv.reader(infile)
}
And I'm using that to assign the variable I use to send the email
email = email_dict[ID]['email']