gpt4 book ai didi

Python O365 发送邮件

转载 作者:太空宇宙 更新时间:2023-11-04 05:05:28 25 4
gpt4 key购买 nike

我正在尝试使用电子邮件 rolodex 的数据框将附件和求职信迭代到数据框中找到的索引数量。谁能告诉我如何通过下面的 i 为每个设置引用特定的列?谢谢

body_of_email = "This is a call to arms" 
for i in email_list:
#Send to Recipients individually from list
m.setRecipients(i.columns[2])
#Attachments
m.attachments.append(excel_att)
m.attachments.append(cover_letter)
m.setSubject(i.columns[1] + ' I made an email script.')
m.setBody(body_of_email)
m.sendMessage()

email_list 是一个 3 列,编号,姓名,email_address

最佳答案

让我们使用itertuples:

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()

关于Python O365 发送邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44638960/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com