Advertisement

用Python开发自动化邮件发送系统(匿名)

阅读量:

为达成邮件发送功能,首先需要对邮件的发送流程有所了解,此处不再展开说明,建议读者自行查阅相关资料或访问http://www.sogouqa.com/?p=438>进行查看。

在掌握了邮件发送机制之后,若要实现邮件的全自动匿名发送功能,需借助Windows系统中的命令行工具,对匿名邮件服务器进行解析,并通过该服务器将邮件发送至目标邮箱。

代码如下:

复制代码
 def _get_mail_exchanger(domain_name,name_server=""):

    
     #print domain_name
    
     temp_file=os.getenv("temp")+"\ temp.lsh"
    
     os.system("nslookup -qt=mx "+domain_name+" "+name_server+" >"+temp_file+" 2>&1")
    
     f=open(temp_file)
    
     c=f.read()
    
     f.close()
    
     os.remove(temp_file)
    
     #print c
    
     internet_addresses_map=_get_internet_address(c)
    
     mai

全部评论 (0)

还没有任何评论哟~