Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $to = $customerEmail;
- $from = config_item('email_from');
- $url = 'https://api.sendgrid.com/';
- $user = 'abhishekp';
- $pass = 'abhishekp@123';
- $params = array(
- 'api_user' => $user,
- 'api_key' => $pass,
- 'to' => $to,
- 'fromname' => 'DreamsOffers',
- 'from' => $from,
- 'subject' => $subject,
- 'html' => $content);
- $request = $url . 'api/mail.send.json';
- // Generate curl request
- $session = curl_init($request);
- // Tell curl to use HTTP POST
- curl_setopt($session, CURLOPT_POST, true);
- // Tell curl that this is the body of the POST
- curl_setopt($session, CURLOPT_POSTFIELDS, $params);
- // Tell curl not to return headers, but do return the response
- curl_setopt($session, CURLOPT_HEADER, false);
- // Tell PHP not to use SSLv3 (instead opting for TLS)
- //curl_setopt($session, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
- curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
- // obtain response
- $response = curl_exec($session);
- curl_close($session);
Add Comment
Please, Sign In to add comment