pyapple
pyapple

Reputation: 3

Python: Sending an Email including CC

msg['From'] = email_from

msg['To'] = "[email protected]"

msg['Cc'] = "[email protected], [email protected]"

...


server.sendmail(email_from, "[email protected], [email protected], [email protected]", msg.as_string())

I sent an email through above code. (Those three emails are mine, so I can check up all of them)

I see an email that I sent through python code in the inbox of "aaa", and there clearly shows that two other emails ("bbb" and "ccc") on the CC list.

However, I cannot find the email either "bbb"/"ccc" inbox. I want to figure out what is happening behind and why the email is not sent to those two emails.

Upvotes: 0

Views: 61

Answers (1)

John Arnok
John Arnok

Reputation: 632

When you send the email the to and cc emails must be in an array. So the correct form of the command should be like this:

server.sendemail(email_from, ["[email protected]","[email protected]","[email protected]"], msg.as_string())

Upvotes: 1

Related Questions