Emailer system used by Raja

Almost final. Few suggestions from Raja can be implemented