Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $remote_socket = 'ssl://34.160.13.42:465';
- // Set ssl context options, see http://php.net/manual/en/context.ssl.php
- $options['ssl'] = array('peer_name' => 'ssl://smtp.mailgun.org', 'verify_peer' => true, 'verify_peer_name' => true, 'allow_self_signed' => false);
- $socket_context = stream_context_create($options);
- $socket = @stream_socket_client($remote_socket, $errno, $errstr, 20, STREAM_CLIENT_CONNECT, $socket_context);
- if (!$socket)
- {
- echo $errno.' '.$errstr."\n";
- return;
- }
- $server_response = fgets($socket, 256);
- echo $server_response;
- fclose($socket);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement