SSHMonitor.py 文件源码

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

项目:SSHMonitorPy 作者: amboxer21 项目源码 文件源码
def send_mail(sender,to,password,port,subject,body):
    try:
        message = "Subject: {}\n\n{}".format(subject,body)
        mail = smtplib.SMTP('smtp.gmail.com',port)
        mail.starttls()
        mail.login(sender,password)
        mail.sendmail(sender, to, message)
        print "\nSent email successfully.\n"
    except smtplib.SMTPAuthenticationError:
        print "\nCould not athenticate with password and username!\n"
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号