Send mail function updated, old one is deleted.