a wrapper for mail sent from php mail function