added changes to web config and mail function