Added code for email sending with attachment