How to config phpmailer with gmail

This tutorial will show how to config phpmailer with gmail

$phpmailer->isSMTP();
$phpmailer->Host       = 'smtp.gmail.com';
$phpmailer->Port       = '465';
$phpmailer->SMTPSecure = 'ssl';
$phpmailer->SMTPAuth   = true;
$phpmailer->Username   = '[[email protected]]';
$phpmailer->Password   = '[your gmail apps password]';
$phpmailer->From       = '[[email protected]]';
$phpmailer->FromName   = '[your custom name to send the email]';

how to create & use app passwords

Important: To create an app password, you need 2-Step Verification on your Google Account.

If you use 2-Step-Verification and get a “password incorrect” error when you sign in, you can try to use an app password.

  1. Go to your Google Account.
  2. Select Security.
  3. Under “Signing in to Google,” select 2-Step Verification.
  4. At the bottom of the page, select App passwords.
  5. Enter a name that helps you remember where you’ll use the app password.
  6. Select Generate.
  7. To enter the app password, follow the instructions on your screen. The app password is the 16-character code that generates on your device.
  8. Select Done.

more details:

https://support.google.com/accounts/answer/185833

If you want latest update and find more tips and tricks to build your own business platform, please checkout more articles on https://www.productdeploy.com and https://blog.productdeploy.com

Share This

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*
*