Skip to content

Instantly share code, notes, and snippets.

@eksiscloud
Created October 28, 2019 09:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eksiscloud/9f3f60dc346d8328fd0ca5b6846c8daa to your computer and use it in GitHub Desktop.
Save eksiscloud/9f3f60dc346d8328fd0ca5b6846c8daa to your computer and use it in GitHub Desktop.
Wordpress: Use Amazon SES with PHPMailer
add_action( 'phpmailer_init', 'set_phpmailer_details' );
function set_phpmailer_details( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = 'SMTP_endpoint'; //Amazon SES SMTP endpoint for your region
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 587;
$phpmailer->Username = 'Amazon_SES_USERNAME';
$phpmailer->Password = 'Amazon_SES_PASSWORD';
$phpmailer->SMTPSecure = 'tls';
$phpmailer->From = get_option('admin_email'); //your verified email address
$phpmailer->FromName = "Your Name";
@eksiscloud
Copy link
Author

Add in functions.php of (child)theme or use Snippets plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment