Last active
December 17, 2015 04:58
-
-
Save mustafauysal/5553961 to your computer and use it in GitHub Desktop.
Send WordPress system mails via SMTP.
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
| <?php | |
| function wp_smtp($phpmailer){ | |
| $phpmailer->Mailer = "smtp"; | |
| $phpmailer->From = "System"; | |
| $phpmailer->FromName = "System Name"; | |
| $phpmailer->Sender = "no_reply@example.com"; | |
| $phpmailer->AddReplyTo($phpmailer->From,$phpmailer->FromName); | |
| $phpmailer->Host = 'smtp.gmail.com'; | |
| $phpmailer->SMTPSecure = 'tls'; | |
| $phpmailer->Port = 587; | |
| $phpmailer->SMTPAuth = TRUE; | |
| if($phpmailer->SMTPAuth){ | |
| $phpmailer->Username = "mailaddress@gmail.com"; | |
| $phpmailer->Password = "passwordhere"; | |
| } | |
| } | |
| add_action('phpmailer_init','wp_smtp'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment