improve SMTP

bug fix #45, update issue #44, #39 and #43