Skip to content

Instantly share code, notes, and snippets.

@tokune
Created September 13, 2012 10:47
Show Gist options
  • Save tokune/3713532 to your computer and use it in GitHub Desktop.
Save tokune/3713532 to your computer and use it in GitHub Desktop.
email
#!/usr/bin/env python
#-*-coding:utf-8-*-
import os
import codecs
import itertools
import time
def main(template = 'template.html'):
i = 0
for root, dirs, files in os.walk('college-/'):
if i%10 == 0:
time.sleep(10)
for name in files:
if name.endswith('.jpg'):
source = os.path.join(root, name)
cmd = 'mutt -s \'大学\' [email protected] -a '+source+' < .'
print cmd
result=os.system(cmd)
i+=1
print '发送邮件编号:'+str(i)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment