add html template
merge with viktor
fix some bugs at send email