uncommented the sending mail and added a few comments