概要
xamppでgmailからメールを送信する際の設定方法です。
1.googleのアカウント設定の「セキュリティ」から2段階認証プロセスをオンにする。
2.2段階認証プロセス画面の一番したにある「アプリパスワード」を設定。
表示されたパスワードを再確認することはできないのでメモしておく。
xampp
1.\php\php.iniの[mail function]でsendmail_path
を編集。
php.iniは念のためにバックアップする。
自分はxamppをDドライブに入れているので"\"D:\xampp\sendmail\sendmail.exe\" -t"
となる。
2.sendmail\sendmail.iniを編集。
smtp_server=smtp.gmail.com
smtp_port=587
auth_username=hoge@gmail.com
auth_password=**** **** **** ****
force_sender=hoge@gmail.com