728x90
반응형
def send(to, cc, bcc, subject, text, html):
message = MIMEMultipart("alternative")
message["Subject"] = subject
message["From"] = MAIL_FROM
message["To"] = to
message["Cc"] = cc + "," + MAIL_DL
if html is not None:
body = MIMEText(html, "html")
else:
body = MIMEText(text)
message.attach(body)
server = smtplib.SMTP(MAIL_SERVER)
server.set_debuglevel(1)
server.sendmail(MAIL_DL, to.split(",") + bcc.split(","), message.as_string())
server.quit()
return {
"to": to,
"cc": cc,
"bcc": bcc,
"subject": subject,
"text": text,
"html": html,
}
BCC not hidden on gmail using python smtplib
I am working on a python script to send email to my customer with a survey. I will send only one email with all my customers's emails in the BCC field so that I do not need to loop through all the ...
stackoverflow.com
728x90
반응형
'공부 (@Deprecated)' 카테고리의 다른 글
| [Python] string format range text (0) | 2021.07.25 |
|---|---|
| [Linux] overwrite symbolic link (0) | 2021.07.25 |
| [SQL] UNION(DISTINCT) & UNION ALL (0) | 2021.07.24 |
| [Java] cast object by generic (0) | 2021.07.24 |
| [Linux] clear kerberos (kdestroy) (0) | 2021.07.24 |