Fix smtp email sending bug.
Merge pull request #1340 from hellaslubo/smtp-patch

Fix smtp email sending bug.