FortiMail.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:Fortigate-Anomally-Alert 作者: farcompen 项目源码 文件源码
def mail(self):

        gonderen = "sender e-mail"
        pswd = "sender e-mail passwd"
        alici = "receiver e mail "
        cc = "if you need add cc e-mail "
        body=self.mesaj
        messg = MIMEMultipart()
        messg['To'] = alici
        messg['Cc'] = cc
        messg['From'] = gonderen
        messg['Subject'] = "ANomaly tespit sistemi"

        text = MIMEText(body, 'plain')
        messg.attach(text)
        print(self.mesaj)
        try:
            server = smtplib.SMTP("smtp.live.com", 587)
            server.starttls()
            server.login(gonderen, pswd)
            server.sendmail(gonderen,[alici,cc,alici],messg.as_string())
            server.close()
            print("mail gönderildi")
        except smtplib.SMTPException as e:
            print(str(e))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号