Python O365模块突然停止工作

时间:2019-01-30 03:49:04

标签: python python-3.x

我正在使用O365 python模块发送电子邮件。几天后突然停止工作(没有电子邮件通过),我无法确定问题所在。我正在提供我的代码以供参考。我正在使用python 3.6

from O365 import Message
from O365 import Attachment

def sendemail(to, subj, content, filepath):
        #msg.attach(fileattachment)
        o365_auth = (ID, PASS)
        m = Message(auth=o365_auth)
        m.setRecipients(to)
        m.setSubject(subj)
        m.setBody(content)
        if len(filepath)>1:
            att = Attachment(path=filepath)
            m.attachments.append(att)
        m.sendMessage()


#filepath = "test.csv"
sendemail(to, subj, content, filepath)

0 个答案:

没有答案