http-request function and mail functino