Python O365发送电子邮件

Python O365发送电子邮件,python,pandas,email,office365,Python,Pandas,Email,Office365,我正在尝试使用电子邮件rolodex的数据框来迭代附件和封面信,以获得数据框中找到的索引量。有人能告诉我如何通过下面的i引用每个设置的特定列吗? 谢谢 电子邮件列表由3列组成,编号、姓名、电子邮件地址 for i in email_list.itertuples(): #Send to Recipients individually from list 使用: 或 或 非常感谢,附件每次重复都会有原因吗?您熟悉O365吗?无论iterrows itertuples如何,附件似乎都会不断

我正在尝试使用电子邮件rolodex的数据框来迭代附件和封面信,以获得数据框中找到的索引量。有人能告诉我如何通过下面的i引用每个设置的特定列吗? 谢谢


电子邮件列表由3列组成,编号、姓名、电子邮件地址

for i in email_list.itertuples():
    #Send to Recipients individually from list
使用:


非常感谢,附件每次重复都会有原因吗?您熟悉O365吗?无论iterrows itertuples如何,附件似乎都会不断添加到每个额外的电子邮件行中。我没有O365的经验,只有熊猫。您可以尝试在for循环中使用print语句来查看发生了什么。
for i in email_list.itertuples():
    #Send to Recipients individually from list
    m.setRecipients(i.email_address)
    m.setRecipients(i[2])
    #Attachments
    m.attachments.append(excel_att)
    m.attachments.append(cover_letter)
    m.setSubject(i.name + ' I made an email script.')
    m.setSubject(i[1] + ' I made an email script.')
    m.setBody(body_of_email)
    m.sendMessage()