PHPMailerを約1週間稼働させようとしています。最初は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
これはインクルードがないか、どこかで必要と思われるので、require( 'vendor/autoload.php')を追加しようとしました。私のPHPでは、郵送のプロセスを開始すべきフォームを扱いますが、何も解決していないようです。また、/ phpmailer /のファイルにそのようなものを追加する必要があるとは思わない。
私はこのようなルックスを返されますログの残り:
2017年3月26日午前10時23分52秒、SERVER - > CLIENT: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-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN P LAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8
実際に認証に問題はないようです。
これはcomposer.jsonに何である:
{
"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"
}
私はここで何かが足りないのですか?
作曲者jsonファイルのコンテンツを投稿できますか?どのモジュールとクラスがあなたのPHPのクラスパスに追加されるかを制御するからです。 – emeraldjava
こんにちは、私の最初の投稿でcomposer.jsonの内容を追加しました – GeirrBenayahu