Your SlideShare is downloading. ×
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
How to send Farewell e-mails or How to became a SP*MMER
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

How to send Farewell e-mails or How to became a SP*MMER

1,229

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,229
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. エキPy読書会 第二期 04 Lightning Talk 2012-03-12 Takanori Suzuki
    • 2. お前だれよ• 鈴木たかのり• Twitter: @takanory• http://takanory.net/• Pythonボルダリング部(#kabepy) 部長
    • 3. 私事(わたくしごと) ですが
    • 4. 2月末で退職しました
    • 5. 2月末に退職しました
    • 6. 2月末に退職しました
    • 7. 2月末に退職しました• で、まぁここでなんで退職してなんでそこに 入ったか何をするかとか書いたりするんです けど、それもつまらないので最終日に作成し た退職メールを送るまでの道のりについて書 きます。 • http://takanory.net/takalog/1284
    • 8. というわけで
    • 9. How To Send Farewell E- mails お別れメールの送り方
    • 10. orまたは
    • 11. How To Became A SP*MMERいかにしてス⃝マーになったか
    • 12. 手順• 送信先アドレスの抽出• メールアドレスの名寄せ• 送受信数ランク分け、コメント追加• メールを送信
    • 13. 送信先アドレスの抽出
    • 14. 送信先アドレスの抽出 • Maildirから各メールを抜き出すimport mailboxif __name__ == __main__: maildir = mailbox.Maildir("~/Maildir", None, create=False) for folder in maildir.list_folders(): if folder.find("ham") != -1: # 条件に合致するフォルダのみ folder = maildir.get_folder(folder) for key in folder.iterkeys(): try: message = folder[key] # From, To, Cc のメールアドレスを取得 fromaddr = message[From] tolist = message[To] cclist = message[Cc] # メール送信対象のアドレスかを解析する except:
    • 15. 送信先アドレスの抽出 • メールアドレス部分のみを抜き出すimport mailboximport rfc822: message = folder[key] fromaddr = message[From] tolist = message[To] cclist = message[Cc] fromaddr = rfc822.parseaddr(fromaddr)[1].lower() tolist = [i[1].lower() for i in rfc822.AddressList(tolist)] cclist = [i[1].lower() for i in rfc822.AddressList(cclist)]
    • 16. メールアドレスの名寄せ
    • 17. メールアドレスの名寄せ• 同じ会社に長くいたので、ドメインが 変わっている (hoge.co.jp→hoge.com)• sed で地道に変更• “sort | uniq -c”で出現数の取得
    • 18. ランク分け、コメント追加
    • 19. ランク分け、コメント追加• 自分が送信者/受信者、To/Cc• メールアドレスごとにCSVファイルに まとめる• 数が多い人で足切り• 個別コメントを追加
    • 20. メールを送信
    • 21. import smtplib メールを送信from email.mime.text import MIMETextfrom email.Header import Headerif __name__ == __main__: : with open("address-list.csv") as f: for line in f: (addr, message) = line.rstrip().split(",") # メールの本文を作成 message = unicode(message, encoding) msg = MIMEText(TEXT % message, plain, encoding) # メールのヘッダを設定 msg[Subject] = Header(u退職のお知らせ, encoding) msg[From] = "Takanori Suzuki <takanori@kuzo.ham.jp>" msg[To] = addr # メールを送信する s = smtplib.SMTP() s.connect() s.sendmail(me, addr, msg.as_string())
    • 22. 詳しくはWebで• http://takanory.net/takalog/1284• http://gigazine.net/news/20120305- headline/
    • 23. One more thing...
    • 24. トランペット買いました
    • 25. 演奏会やります• 4月29日(日) 14:00• 南大沢文化会館• 「空」と「宙」
    • 26. 演奏会やります• 4月29日(日) 14:00 チラシご持参の方• 南大沢文化会館 入場無料!!!!• 「空」と「宙」
    • 27. ありがとうございました

    ×