2017-03-26 1 views
0

저는 약 일주일 동안 PHPMailer를 사용하려고했습니다. 처음에는 SMTP를 사용하지 않았지만 PHP 권한으로 인해이를 변경해야했습니다.PHPMailer : Gmail의 SMTP를 사용하려고 할 때 클래스 이름을 찾을 수 없습니다.

사용중인 이메일 주소가 Gmail (@ gmail.com이 아닌 다른 도메인)을 통해 구입 한 것 같습니다. Google의 Gmail SMTP 서비스를 사용하는 것이 가장 좋은 방법이라고 생각했습니다. (여기에 설명되어 있습니다 https://github.com/PHPMailer/PHPMailer/wiki/Using-Gmail-with-XOAUTH2)

경험이없고 명령 행을 통해 호스트에 접근 할 방법이 없기 때문에 로컬로 설치된 버전의 작성자와 함께 모든 필요한 패키지를 얻었고 모든 종속성을 FTP를 통해 내 호스트에 복사했습니다. 나의 현재 폴더 구조는 다음과 같이 지금 :

/phpmailer 
/phpmailer/extras/ 
/phpmailer/language/ 
/phpmailer/vendor/ 
/phpmailer/vendor/composer/ 
/phpmailer/vendor/eloquent/ 
/phpmailer/vendor/guzzlehttp/ 
/phpmailer/vendor/league/ 
/phpmailer/vendor/paragonie/ 
/phpmailer/vendor/phpmailer/ 
/phpmailer/vendor/psr/ 
/phpmailer/vendor/autoload.php 

그러나, 나는 다음과 같은 오류가 점점 계속 :

치명적인 오류 : 클래스 '리그 \ OAuth2를 \ 클라이언트 \ 제공 \ 구글이'/ 도메인에서 찾을 수 없습니다/phpmailer/class.phpmaileroauthgoogle.php on line 55

include가 없거나 어딘가에있는 것처럼 보이므로 require ('vendor/autoload.php'); 메일 링 프로세스를 시작해야하는 양식을 처리하는 PHP에서,하지만 아무 것도 해결하지 못하는 것 같습니다. 그리고 필자는/phpmailer /에있는 파일에 이와 비슷한 것을 추가하는 것이 필요하다고 생각하지 않습니다.

이 같은 모습을 반환받을 로그의 나머지 :

2017년 3월 26일 10시 23분 52초 서버 -> 클라이언트 : 220 smtp.gmail.com ESMTP e16sm10314377wra.62 - gsmtp 2017- 03-26 10:23:52 클라이언트 -> 서버 : EHLO www.domain.com 2017-03-26 10:23:53 서버 -> 고객 : 250-smtp.gmail.com 서비스 [2a0b : 7280 : 100 : 0 : 447 : 56ff : fe00 : 207b] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8 2017-03-26 10:23:53 클라이언트 -> 서버 : STARTTLS 2017 -03-26 10:23:53 서버 -> 클라이언트 : 220 2.0.0 TLS 시작 준비 2017-03-26 10:23:53 클라이언트 -> 서버 : EHLO www.domain.com 2017-03-26 10 : 23:53 서버 -> 고객 : 250-smtp.gmail.com 서비스, [2a0b : 7280 : 100 : 0 : 447 : 56ff : fe00 : 207b] 250 크기 35882577 250-8BITMIME 250-AUTH LOGIN P 라틴어 XOAUTH2 일반 클라이언트 CLIENTTOKEN OAUTHBEARER 250 개 확장형 250 개 파이프 250 개 파이프 250 개 팅킹 250 개 SMTPUTF8

실제로 인증에는 문제가없는 것 같습니다.

{ 
"name": "phpmailer/phpmailer", 
"type": "library", 
"description": "PHPMailer is a full-featured email creation and transfer class for PHP", 
"authors": [ 
    { 
     "name": "Marcus Bointon", 
     "email": "[email protected]" 
    }, 
    { 
     "name": "Jim Jagielski", 
     "email": "[email protected]" 
    }, 
    { 
     "name": "Andy Prevost", 
     "email": "[email protected]" 
    }, 
    { 
     "name": "Brent R. Matzelle" 
    } 
], 
"require": { 
    "php": ">=5.0.0", 
    "phpmailer/phpmailer": "^5.2", 
    "league/oauth2-client": "^2.2", 
    "league/oauth2-google": "^2.0" 
}, 
"require-dev": { 
    "doctrine/annotations": "1.2.*", 
    "jms/serializer": "0.16.*", 
    "phpdocumentor/phpdocumentor": "2.*", 
    "phpunit/phpunit": "4.8.*", 
    "symfony/debug": "2.8.*", 
    "symfony/filesystem": "2.8.*", 
    "symfony/translation": "2.8.*", 
    "symfony/yaml": "2.8.*", 
    "zendframework/zend-cache": "2.5.1", 
    "zendframework/zend-config": "2.5.1", 
    "zendframework/zend-eventmanager": "2.5.1", 
    "zendframework/zend-filter": "2.5.1", 
    "zendframework/zend-i18n": "2.5.1", 
    "zendframework/zend-json": "2.5.1", 
    "zendframework/zend-math": "2.5.1", 
    "zendframework/zend-serializer": "2.5.*", 
    "zendframework/zend-servicemanager": "2.5.*", 
    "zendframework/zend-stdlib": "2.5.1" 
}, 
"suggest": { 
    "league/oauth2-google": "Needed for Google XOAUTH2 authentication" 
}, 
"autoload": { 
    "classmap": [ 
     "class.phpmailer.php", 
     "class.phpmaileroauth.php", 
     "class.phpmaileroauthgoogle.php", 
     "class.smtp.php", 
     "class.pop3.php", 
     "extras/EasyPeasyICS.php", 
     "extras/ntlm_sasl_client.php" 
    ] 
}, 
"license": "LGPL-2.1" 
} 

내가 여기서 뭔가를 놓치고 있습니까 :

이것은 composer.json에 무엇입니까?

+0

작곡가 json 파일의 내용을 게시 할 수 있습니까? 왜냐하면 어떤 모듈과 클래스가 PHP의 클래스 패스에 추가되는지 제어하기 때문입니다. – emeraldjava

+0

안녕하세요, 초기 게시물에 composer.json의 내용을 추가했습니다. – GeirrBenayahu

답변

0

(편집 : 죄송합니다, 나는 이미 composer.json에 종속성을 추가 거라고 보지 않았다) 추가 종속성이 정말 될 것을

자신의 애플 리케이션의 composer.json (안 PHPMailer의), 당신 때문에 작곡가를 통해로드 된 패키지를 편집 할 필요가 없습니다. composer update (단지 composer install이 아님)을 실행하면됩니다. 그렇지 않으면 추가 한 패키지가 아닌 최신 composer.lock 파일의 패키지 만로드합니다.

+0

안녕하세요, 답장을 보내 주셔서 감사합니다. 결과적으로 'composer update'를 실행하여 결과를 내 호스트로 전송했지만, 여전히'치명적 오류 : 클래스 'League \ OAuth2 \ Client \ Provider \ Google'은 /phpmailer/class.phpmaileroauthgoogle에 없습니다.PHP는 온라인 55'. 내 응용 프로그램의 json 파일에 어떤 종속성을 언급하고 있습니까? 필자가 아는 한, 필자는 오직 하나의'composer.json' 만 가지고 있으며,/phpmailer /에있다. – GeirrBenayahu

+0

작곡가를 업데이트하면 훨씬 적은 내용의'composer.json'을 얻습니다. "require : {...}"만 포함합니다. – GeirrBenayahu

관련 문제