Last active
August 29, 2015 14:16
-
-
Save jonathanbardo/3f6131d1d600113b418c to your computer and use it in GitHub Desktop.
Send email using WordPress
This file contains 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
function smtp_mail( $phpmailer ) { | |
// Define that we are sending with SMTP | |
$phpmailer->isSMTP(); | |
// The hostname of the mail server | |
$phpmailer->Host = YOURHOST; | |
// Use SMTP authentication (true|false) | |
$phpmailer->SMTPAuth = true; | |
// SMTP port number normally 25 | |
$phpmailer->Port = '25'; | |
// Username to use for SMTP authentication | |
$phpmailer->Username = USERNAME; | |
// Password to use for SMTP authentication | |
$phpmailer->Password = PASSWORD; | |
$phpmailer->From = FROM; | |
$phpmailer->FromName = FROMNAME; | |
} | |
add_action( 'phpmailer_init', 'smtp_mail', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment