hallo alle nehmen Sie bitte einen Blick auf die unten Codes anrufen und mir helfen, das Problem herauszufinden ..„Nicht unterstütztes SSL-Protokoll-Version“ bei dem Versuch, SendGrid API
$tos='[email protected]';
$subject09='hello madam223';
$messageto90='this is a test';
$myName_emailis='Sonam verma';
$emaillist_act=array('[email protected]','[email protected]');
$json_string = array('to' =>$emaillist_act,'category' => 'activity');
$url = 'https://api.sendgrid.com/';
$user = 'username';
$pass = 'password';
$params = array(
'api_user' => $user,
'api_key' => $pass,
'x-smtpapi' => json_encode($json_string),
'to' => "$tos",
'subject' => "$subject09",
'html' => "$messageto90",
'fromname' => $myName_emailis,
'from' => "domain.com <[email protected]>"
);
$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_RETURNTRANSFER, true);
// obtain response
$response = curl_exec($session);
curl_close($session);
print_r($response);
?>
Dieser Code funktioniert auf anderen Server http://www.reurl.in/6626fdd53 aber es Dosent tun alles auf meinem Server http://www.reurl.in/26cbacc87 es Dosent druckt alles, was es soll die Antwort Erfolg drucken oder scheitern etc ..
Dieser Code funktioniert gut auf dem Server.
<?php
//Your authentication key
$authKey = "somethingapikey";
//Multiple mobiles numbers separated by comma
$mobileNumber = "$mobileno";
//Sender ID,While using route4 sender id should be 6 characters long.
$senderId = "something";
//Your message to send, Add URL encoding here.
if(strlen($textsms) > 300){
$message = urlencode(substr($textsms,0,300));
$message=$message.'...'. ' www.domain.com';
}else{
$textsms=$textsms.' www.domain.com';
$message = urlencode($textsms);
}
//Define route
$route = "domain";
//Prepare you post parameters
$postData = array(
'authkey' => $authKey,
'mobiles' => $mobileNumber,
'message' => $message,
'sender' => $senderId,
'route' => $route
);
//API URL
$url="https://control.msg91.com/api/sendhttp.php";
// init the resource
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postData
//,CURLOPT_FOLLOWLOCATION => true
));
//Ignore SSL certificate verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
//get response
$output = curl_exec($ch);
//Print error if any
//if(curl_errno($ch))
//{
// echo 'error:' . curl_error($ch);
//}
curl_close($ch);
//echo $output;
?>
Bitte helfen Sie mir, das Problem eingrenzen, da dies für mich sehr wichtig ist, bitte ... Mein Server Admin sagt sie Hilfe kann nicht.
i verengt auch die Frage, die wir haben curl Version 7.38.0 und andere Server hat 7.19.7
die Fehler sind auf alle Reportings aber bin immer noch nicht keine Fehler i keinen Erfolg keine Post bekommen nichts.
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
Nach dem Hinzufügen der
$error = curl_error($session);
echo $error;
i bekommen
Unsupported SSL protocol version
es ist bereits auf ich verwendet ini_set ('display_errors', 1); ini_set ('display_startup_errors', 1); error_reporting (E_ALL); –
lassen Sie mich einen Moment bitte überprüfen .. –
, wie zu prüfen, was soll ich in Parameter? –