You Don’t Need an SMTP Plugin for WordPress

Why not do this instead?

add_action( 'phpmailer_init', function( $phpmailer ) {
  $phpmailer->Host       = 'smtp.example.org';
  $phpmailer->Port       = 587;
  $phpmailer->Username   = 'your-username-here';
  $phpmailer->Password   = 'your-password-here';
  $phpmailer->SMTPAuth   = true;
  $phpmailer->SMTPSecure = 'tls';
  $phpmailer->IsSMTP();
} );

(Adjust as required.)

Likes, Bookmarks, and Reposts

  • Dâng David

2 responses to “You Don’t Need an SMTP Plugin for WordPress”

  1. STUDIO ЮИ Avatar

    … favorited this!

  2. Nathan DeGruchy Avatar

    @jan That is actually exactly what I do. Except it’s in a mu plugin file.