=== GMAIL ===
Password: You can generate an App password. Using this Google App Password Link or go to Google Account Settings>Security>App Password.
=== GMAIL ===
Password: You can generate an App password. Using this Google App Password Link or go to Google Account Settings>Security>App Password.
| <?php | |
| //Create phpmailer SMTP | |
| add_action( 'phpmailer_init', 'chr_phpmailer_smtp' ); | |
| function chr_phpmailer_smtp( $phpmailer ) { | |
| $phpmailer->isSMTP(); | |
| $phpmailer->Host = SMTP_server; | |
| $phpmailer->SMTPAuth = SMTP_AUTH; | |
| $phpmailer->Port = SMTP_PORT; | |
| $phpmailer->Username = SMTP_username; | |
| $phpmailer->Password = SMTP_password; | |
| $phpmailer->SMTPSecure = SMTP_SECURE; | |
| $phpmailer->From = SMTP_FROM; | |
| $phpmailer->FromName = SMTP_NAME; | |
| } |
| <?php | |
| // SMTP email settings | |
| define( 'SMTP_username', '[email protected]' ); // username of host like Gmail | |
| define( 'SMTP_password', 'password' ); // password for login into the App | |
| define( 'SMTP_server', 'smtp.mail.com' ); // SMTP server address | |
| define( 'SMTP_FROM', '[email protected]' ); // Your Business Email Address | |
| define( 'SMTP_NAME', 'CHR Designer' ); // Business From Name | |
| define( 'SMTP_PORT', '587' ); // Server Port Number | |
| define( 'SMTP_SECURE', 'tls' ); // Encryption - ssl or tls | |
| define( 'SMTP_AUTH', true ); // Use SMTP authentication (true|false) | |
| define( 'SMTP_DEBUG', 0 ); // for debugging purposes only |