add general mail function
Merge branch 'send_mail'