created mail function using phpmailer