Fix crash due to email related changes

- Fix the changes introduced by Shekhi while he was high!!
- template seems to be working
- commented a few lines of code which were not defined properly
- More changes still pending to have email working.

Signed-off-by: Kumar Vishal <vishal733@gmail.com>