Using a dictionary to pull Email Addresses. Some key's have multiple emails, how do I send to all emails?

AlliDeacon

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']
Riccati

Hard to answer with only the info given so far, but it looks like d[ID]=[email1, email2, etc] where d is your dictionary. d[ID] is a list of emails corresponding to ID. If you want to send email to a list of email addresses, this question is a good one to look at: Send Email to multiple recipients from .txt file with Python smtplib

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I send emails through PHP to GMail?

How can I Create HTML emails to work in all email clients?

How do I get django-allauth to send html emails

Send emails altomaticamente, from email addresses stored in the firebase

How do i send emails with attachments in react native (using my own SMTP server)?

how to send mails to multiple list of emails from a database using php

How do I send to multiple emails after getting the email from query results?

I cannot send an Email using the Java Mail API the email is sent but is not received or displayed in the emails sent

R: How do I split an email into parts when the emails have multiple domain endings?

Laravel 7- How do I send emails in laravel using SendinBlue?

I want to attach multiple email addresses to a single inbox and then filter the emails that are received into folders

How to send emails in python as other email?

Using mailcore (iOS), how could I get all emails from a specific email address?

How to download all the raw emails using some email client?

Send emails from several email forms to several email addresses

How to retrieve emails from multiple emails addresses using pop3 of gem mail in Rails?

How do I configure postfix on 2 VMs to send/receive emails?

How do you send 2 emails to two different email addresses in Java?

Unable to send Emails to university email addresses

How do I set Cron to send emails?

how to bypass DMARC for send emails by using any email for users

Laravel :How to send emails to email addresses which are inside the database using a button

How to find all users that have emails in an array in prisma using Typescript?

How can I send multiple emails to different individuals in appscripts

How to send multiple emails using EmailOperator in Airflow

I am new to this google script. How to send automated emails (consisting a hyperlink) to multiple addresses in google sheets using google script?

How to send multiple emails in a loop with attachments using Python

How do I send emails through gmail via app passwords?

How do I configure Thunderbird to send plain text emails by default?