config_load('send_grid_user'), 'api_key' => config_load('send_grid_key'), 'to' => $to, 'subject' => $subject, 'from' => $from, 'html' => $message, ); $params['text'] = strip_tags($params['html']); $res = run_api($url_send_grid, $params); if (isset($res['message']) && $res['message'] == 'success') { echo 'ok'; }else{ echo'not ok'; }