corrected bad 'to' parameter in mail function