Cant use mailgun Api

i cant use mailgun api , code works fine in my pc, but not here. here is the error - Fatal error : Uncaught Buzz\Exception\NetworkException: file_get_contents(https://api.mailgun.net/v3/mg.mandatorytrendz.com/messages): failed to open stream: operation failed in /home/vol2_6/epizy.com/epiz_23679247/students.mandatorytrendz.com/htdocs/vendor/kriswallsmith/buzz/lib/Client/FileGetContents.php:26 Stack trace: #0 /home/vol2_6/epizy.com/epiz_23679247/students.mandatorytrendz.com/htdocs/vendor/php-http/client-common/src/HttpClientDecorator.php(30): Buzz\Client\FileGetContents->sendRequest(Object(Nyholm\Psr7\Request)) #1 /home/vol2_6/epizy.com/epiz_23679247/students.mandatorytrendz.com/htdocs/vendor/php-http/client-common/src/PluginClient.php(84): Http\Client\Common\EmulatedHttpAsyncClient->sendRequest(Object(Nyholm\Psr7\Request)) #2 /home/vol2_6/epizy.com/epiz_23679247/students.mandatorytrendz.com/htdocs/vendor/php-http/client-common/src/Plugin/HistoryPlugin.php(39): Http\Client\Common\PluginClient->Http\Client\Common{closure}(Object(Nyholm\Psr7\Request)) #3 /home/vol2_6/epizy.com/epiz_23679247/students.mandator in /home/vol2_6/epizy.com/epiz_23679247/students.mandatorytrendz.com/htdocs/vendor/mailgun/mailgun-php/src/Exception/HttpServerException.php on line 28

Most likely its the recent issue, caused by an OpenSSL Upgrade. Try replacing the file_get_contents with this:


$opts = stream_context_create(array('ssl' => array('verify_peer'=>false,'verify_peer_name'=>false)));

$result = file_get_contents('https://api.mailgun.net/v3/mg.mandatorytrendz.com/messages', false, $opts);

This is a good temporary solution, if that’s what the problem is, but in the long run, its not good for security. The Admin has said that they are looking into a way to fix this problem.

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.