I am a side dish, recently worried about when the server triggers the trigger value by invoking the script to notify the administrator, Google summed up the decision to try it yourself;
First, the system with smtp.gmail.com for the SMTP host, you must set the mailbox authorization server login;
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8A/22/wKiom1goJ3Dh7CNFAACdpHmS-xg812.jpg-wh_500x0-wm_3 -wmp_4-s_3619960510.jpg "title=" 111.jpg "alt=" Wkiom1goj3dh7cnfaacdphms-xg812.jpg-wh_50 "/>
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8A/1E/wKioL1goJ9TwVN88AACIC6L7NAs222.jpg-wh_500x0-wm_3 -wmp_4-s_3580974713.jpg "title=" 222.jpg "alt=" Wkiol1goj9twvn88aacic6l7nas222.jpg-wh_50 "/>
2. The configuration trigger is the calling script;
[[email protected] python]# cat smtp.py#!/usr/bin/python import smtplib import string host = "Smtp.gmail.com" #定义 smtp host subject = "Test email from python" #邮件主题FROM = "[email protected]" #发件人text = python rules them all " # e-mail content body = string.join ( #组装sendmail方法的邮件主体内容 "from: %s " % FROM, #各段以 " \r\n "to separate "to: %s " % TO, "subject: %s " % SUBJECT, "", text ), "\ r \ n") server = smtplib. SMTP () # Create a  SMTP ( ) Object Server.connect (HOST, "+") #通过 connect Method Connection smtp host Server.starttls () #启用安全传输模式server. Login ("[email protected]", "**password**") #邮箱账号登录校验server. SendMail (from,[to],body) #邮件发送
3. Test results:
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/8A/22/wKiom1goKYCAfUrnAACB1Tuquhs073.jpg-wh_500x0-wm_3 -wmp_4-s_2749992358.jpg "title=" 343.jpg "alt=" Wkiom1gokycafurnaacb1tuquhs073.jpg-wh_50 "/>
Gmail authorized Linux Server login using Gmail to send mail