It also works easily without a plugin:
Add the following to wp-config.php under
/* Add any custom values between this line and the “stop editing” line. */
:
`/* Set the following constants in wp-config.php
* These should be defined somewhere BEFORE the
* ABSPATH constant.
*/
define( ‘SMTP_USER’, ‘mail@example.com’ ); // Username for SMTP authentication
define( ‘SMTP_PASS’, ‘App-PASSWORD’ ); // Password for SMTP authentication
define( ‘SMTP_HOST’, ‘YourMailCowServerHostname’ ); // The hostname of the mail server
define( ‘SMTP_FROM’, ‘mail@example.com’ ); // SMTP “From” email address
define( ‘SMTP_NAME’, ‘Your Websitname’ ); // SMTP “From” name
define( ‘SMTP_PORT’, ‘465’ ); // SMTP port number—likely 25, 465, or 587
define( ‘SMTP_SECURE’, ‘ssl’ ); // Encryption method to use—ssl or tls
define( ‘SMTP_AUTH’, true ); // Use SMTP authentication (true|false)
define( ‘SMTP_DEBUG’, 0 ); // Set to 1 or 2 only for debugging purposes
And this in your Child-Theme functions.php
/**
* This function connects wp_mail to your authenticated
* SMTP server. This improves the reliability of wp_mail and
* prevents many potential problems.
*
* The values are constants set in wp-config.php.
**/
add_action( ‘phpmailer_init’, ‘send_smtp_email’ );
function send_smtp_email( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = SMTP_HOST;
$phpmailer->SMTPAuth = SMTP_AUTH;
$phpmailer->Port = SMTP_PORT;
$phpmailer->Username = SMTP_USER;
$phpmailer->Password = SMTP_PASS;
$phpmailer->SMTPSecure = SMTP_SECURE;
$phpmailer->From = SMTP_FROM;
$phpmailer->FromName = SMTP_NAME;
};
No stupid unsecure Plugin like WP Mail SMTP or anything else.