python中的smtplib无法在通讯组列表(exchange/outlook中的联系人组)中发送电子邮件
电子邮件是从xx@xxx.com到yy@yyy.com成功地 但它还没有发送到电子邮件中group@xxx.com(通讯组名单)还没有。 我担心python中的smtplib不支持在通讯组列表中提取电子邮件 如果支持==>如何修复它? else not support==>对于这种情况,您更愿意申请什么其他软件包python中的smtplib无法在通讯组列表(exchange/outlook中的联系人组)中发送电子邮件,python,email,exchange-server,Python,Email,Exchange Server,电子邮件是从xx@xxx.com到yy@yyy.com成功地 但它还没有发送到电子邮件中group@xxx.com(通讯组名单)还没有。 我担心python中的smtplib不支持在通讯组列表中提取电子邮件 如果支持==>如何修复它? else not support==>对于这种情况,您更愿意申请什么其他软件包 import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import M
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
host = 'xxx.xxx.xxx.xxx'
# email
sender = 'xx@xxx.com'
receivers = ['yy@yyy.com']
# distribution list (contact group)
ccs = ['group@xxx.com']
message = MIMEMultipart("alternative")
message["Subject"] = "Test Send Email"
message["From"] = sender
message["To"] = ','.join(receivers)
message["Cc"] = ','.join(ccs)
# Create the plain-text and HTML version of your message
text = """\
Dear All,
Test Send Email
"""
# Turn these into plain/html MIMEText objects
part_plain = MIMEText(text, "plain")
message.attach(part_plain)
try:
with smtplib.SMTP(host) as mail_server:
mail_server.sendmail(sender, receivers, message.as_string())
print("Successfully sent email")
except smtplib.SMTPException as e:
print('SMTP error occurred: ' + str(e))
多谢各位
Pongthorn“我担心python中的smtplib不支持通讯组列表中的提取电子邮件。”->这不是目标邮件服务器的责任吗?