In php I am trying to send mail using send grid but when I click to send button it show me this message in my web page. How can I do for it? I need help.
I am follow this code:
<?php // Mail Send $url = 'https://api.sendgrid.com/'; $user = 'Rewon'; $pass = 'Pasword'; $json_string = array( 'to' => array( 'example@gmail.com' ), 'category' => 'test_category' ); $params = array( 'api_user' => $user, 'api_key' => $pass, 'x-smtpapi' => json_encode($json_string), 'to' => 'example@gmail.com', 'subject' => 'Verify your Email address', 'html' => $mail_html, 'text' => '', 'from' => 'noreply@example.com', ); $request = $url.'api/mail.send.json'; $session = curl_init($request); curl_setopt ($session, CURLOPT_POST, true); curl_setopt ($session, CURLOPT_POSTFIELDS, $params); curl_setopt($session, CURLOPT_HEADER, false); curl_setopt($session, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($session); curl_close($session); ?>
Question and answer is powered by AnsPress.io