working and sending emails using send_alert_mail