Created
May 1, 2015 18:31
-
-
Save svrooij/db3ac2c847bc574f63bc to your computer and use it in GitHub Desktop.
Wordpress email with Gmail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add the following to your themes functions.php file | |
// Off course, you should never change the parent theme and put all the changes in a child theme | |
add_action( 'phpmailer_init', 'gmail_phpmailer_init' ); | |
function gmail_phpmailer_init( PHPMailer $phpmailer ) { | |
$phpmailer->Host = 'smtp.gmail.com'; | |
$phpmailer->Port = 587; | |
$phpmailer->Username = '[email protected]'; // Full username (with @gmail.com) | |
$phpmailer->Password = 'your_secret_password'; // Your own password | |
$phpmailer->SMTPAuth = true; // Gmail requires authentication | |
$phpmailer->SMTPSecure = 'tls'; //587 is the tls port, ssl can also be configured with 'ssl' and port is another possible value | |
$phpmailer->IsSMTP(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment