Skip to content

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.)

Replies

  1. STUDIO ЮИ STUDIO ЮИ on

    … favorited this!

  2. Nathan DeGruchy Nathan DeGruchy on

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

    Via fosstodon.org, in reply to You Don’t Need an SMTP Plugin for WordPress.