Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python中的smtplib无法在通讯组列表(exchange/outlook中的联系人组)中发送电子邮件_Python_Email_Exchange Server - Fatal编程技术网

python中的smtplib无法在通讯组列表(exchange/outlook中的联系人组)中发送电子邮件

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

电子邮件是从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 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不支持通讯组列表中的提取电子邮件。”->这不是目标邮件服务器的责任吗?