2
PHP와 컬을 사용하여 실시간 메일 서버에서 완전한 응답을 얻으려고합니다. pop3 프로토콜로 연결하려고했지만 작동하지 않습니다.PHP 큐로 outlook.com 메일 서버에 연결
코드 목록 1 :
<?php
// create curl resource
$curl = curl_init();
if($curl) {
/* Set username and password */
curl_setopt($curl, CURLOPT_USERNAME, "[email protected]");
curl_setopt($curl, CURLOPT_PASSWORD, "password");
curl_setopt($curl, CURLOPT_URL, "pop3://pop3.live.com");
curl_setopt($curl, CURLOPT_PORT, 995);
curl_setopt($curl, CURLOPT_USE_SSL,CURLUSESSL_ALL);
curl_setopt($curl, CURLOPT_CAINFO, "./certificate.pem");
curl_setopt($curl, CURLOPT_VERBOSE, true);
//return the transfer as a string
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
// $output contains the output string
$output = curl_exec($curl);
}
echo $output;
curl_close($curl);
?>
이 코드를 사용 (프로토콜 POP3 포함). 표준 출력은 클라이언트가 포트 995에서 성공적으로 연결되었음을 알려줍니다. 그러나 응답을 읽지 못합니다.
응답 독서는
닫기 연결 0
실패하지만 HTTPS 프로토콜 대신에 (같은 코드)에 POP3를 사용할 때 나는 부분 반응을 얻을. 그것은 전체 응답 헤더처럼 보입니다. 적어도 마지막 텍스트 다음에 두 개의 새로운 라인을 출력하기 때문에 보이는 것처럼 보입니다.
수락 : */*