fix bug in writemime
Merge pull request #37 from lebek/master

fix bug in writemime