Add sample mail for Sendmail
Improved code for detecting connection error