⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smstomail.cgi

📁 The Kannel Open Source WAP and SMS gateway works as both an SMS gateway, for implementing keyword b
💻 CGI
字号:
#!/usr/bin/pythonMAIL_SENDER = "liw"MAIL_RECEIVER = "liw"import cgi, os, stringclass Vars:    def __init__(self):    	self._dict = cgi.FieldStorage()    def __getitem__(self, key):    	return self._dict[key].valuedef smstomail():    print "Content-Type: text/plain"    print ""        v = Vars()        f = os.popen("/usr/sbin/sendmail -oi %s" % MAIL_RECEIVER, "w")    f.write("From: %s\nTo: %s\nSubject: SMS message from %s\n\n%s:\n%s\n" %    	    (MAIL_SENDER, MAIL_RECEIVER, v["from"], v["to"], v["text"]))    f.close()        print "Sent via mail to receiver."if __name__ == "__main__":    smstomail()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -