0
벨로우즈 코드 사용 하나의 계정으로 전자 메일을 보낼 수 있지만 어떻게 다중 계정으로 보낼 수 있습니까?smtplib을 사용하여 여러 주소로 전자 메일을 보내려면 어떻게합니까?
import smtplib
from email.mime.text import MIMEText
_user = "[email protected]" #
_pwd = "orjxywulscbxsdwbaii" #
_to = [email protected]" #
msg = MIMEText("content") #
msg["Subject"] = "邮件主题测试" #
msg["From"] = _user
msg["To"] = _to
try:
s = smtplib.SMTP_SSL("smtp.qq.com", 465)
s.login(_user, _pwd)
s.sendmail(_user, _to, msg.as_string())
s.quit()
print ("Success!")
except smtplib.SMTPException as e:
print ("Falied,%s" % e)
의 사용 가능한 복제 [파이썬 : TO, CC와 BCC 메일을 보내는 방법 (https://stackoverflow.com/questions/1546367/python-how -to-send-mail-to-cc-and-bcc) –
이메일 주소 목록을 '_to'로 지정할 수 있습니다.이 's.sendmail (_user, [_to], msg.as_string())' – GeekSambhu
@ GeekSambhu 고마워, 알았다. –