📜  OfficeApi的使用——Python代码示例

📅  最后修改于: 2022-03-11 14:45:58.550000             🧑  作者: Mango

代码示例1
from office365api import Message, Mail
from office365api.model import Recipient, EmailAddress
auth = ('YourAccount@office365.com', 'YourPassword')
message = Message(Subject='Heads up', Body='First automated alarm.',
    From=Recipient(EmailAddress=EmailAddress(Name='Full Name', Address='you@gmail.com')),
    ToRecipients= [Recipient.from_email(email='somebody@gmail.com')]
    )

m = Mail(auth=auth)
m.send_message(message)