Added mail logic