Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define('SMTP_HOST', 'smtp.examplemailer.com');
- define('SMTP_PORT', 587);
- define('SMTP_USER', 'myuser');
- define('SMTP_PASSWORD', 'mypassword');
- define('SMTP_CRYPT', 'tls'); // encryption system (ssl or tls)
- define('SMTP_FROM_EMAIL', 'hello@example.com');
- define('SMTP_FROM_NAME', 'My Company');
- // Send WordPress emails via SMTP
- function forge_smtp_email($phpmailer){
- $phpmailer->isSMTP();
- $phpmailer->Host = SMTP_HOST;
- $phpmailer->SMTPAuth = true;
- $phpmailer->Port = SMTP_PORT;
- $phpmailer->Username = SMTP_USER;
- $phpmailer->Password = SMTP_PASSWORD;
- $phpmailer->SMTPSecure = SMTP_CRYPT;
- $phpmailer->From = SMTP_FROM_EMAIL;
- $phpmailer->FromName = SMTP_FROM_NAME;
- }
- add_action('phpmailer_init', 'forge_smtp_email');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement