前提・実現したいこと
Laravelのtinkrでgmailメールを送信し
gmailで確認するまで行いたい。
https://laraweb.net/practice/998/
こちらのサイトを参考にしています。
発生している問題・エラーメッセージ
tinkerで
Mail::raw('this is the demonstration.',function($message) {$message->to('{xxxxxxx@gmail.com}')->subject('tes t');});
を打つと
Swift_TransportException with message 'Expected response code 354 but got code "503", with message "503 5.5.1 RCPT first. t9sm10534213pjo.4 - gsmtp "'
こちらのエラーコードが出現します。
該当のソースコード
>>> Mail::raw('this is the demonstration.',function($message) {$message->to('{xxxxxxxxx@gmail.com}')->subject('test') ;}); Swift_TransportException with message 'Expected response code 354 but got code "503", with message "503 5.5.1 RCPT first. t9sm10534213pjo.4 - gsmtp "' >>>
試したこと
https://qiita.com/KZ-taran/items/ffa60ac6353bc4dcc759
こちらのサイトの
3.2 二段階認証を有効にし、アプリパスワードを発行する方法
を参考に二段階認証を有効にしてみたり、
port番号を2525から587など別の番号に変化
現在のコード
.env
AIL_MAILER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=自分のgmailアドレス@gmail.com MAIL_PASSWORD=16桁のアプリパスワード MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS=自分のgmailアドレス@gmail.com MAIL_FROM_NAME=livingcollege
email.php
'from' => [ 'address' => env('MAIL_FROM_ADDRESS', null), 'name' => env('MAIL_FROM_NAME', null), ],
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
Composer version 2.0.5
PHP 7.4.9
Laravel Framework 8.11.2
あなたの回答
tips
プレビュー