I'm using Python 2.7.3 and I want to send email with CC.
Something in general like this:
(The subject is just for example)
I have the following function:
def send_email(data):
body = "hello world"
message = MIMEText(body)
message['Subject'] = "File '%s' upload data" % data['filename']
message['From'] = 'noreply@atte-mm.com'
message['To'] = data['send_to']
message['CC'] = 'test@atte-mm.com'
s = smtplib.SMTP(SMTP_HOST)
s.sendmail(EMAIL_SENDER, [data['send_to']], message.as_string())
s.quit()
The function works however it ignores the CC
.
The TO
receive the email without the CC
and of curse the CC
receives nothing.
I didn't find anything useful in the python documentation about SMTP.
Is it possible to send a mail with CC
? If not how do I make it work with two email address in the TO
?