Fixed #195. Refactored into send_email.
Merge pull request #197 from yeukhon/email

Fixed #195. Refactored into send_email.