0

I used this code in my child theme(child theme functions.php):

    add_action( 'phpmailer_init', 'wpse8170_phpmailer_init',0 );
function wpse8170_phpmailer_init( PHPMailer $phpmailer ) {
    $phpmailer->Host = 'your.smtp.server.here';
    $phpmailer->Port = 25; // could be different
    $phpmailer->Username = 'your_username@example.com'; // if required
    $phpmailer->Password = 'yourpassword'; // if required
    $phpmailer->SMTPAuth = true; // if required
    $phpmailer->SMTPSecure = 'ssl'; // enable if required, 'tls' is another possible value

    $phpmailer->IsSMTP();
}

But it doesn't send SMTP mail. I checked the SMTP credentials with SMTP programs(like wp mail SMTP) and they send test email successfully but when I use Contact form 7 plugin it doesn't send mail anymore. My host is cPanel/ GoDady

Could anyone help me?

0

1) Do you see any error on your browser Development Console? Is your email domain same as your site domain? Any read on log files indicating why email is not sent successfully? 2) If you are using Contact Form 7, it has its own mailer class defined, is there any reason you need ph-mailer plugin?

0

1) I'm using WP Mail SMTP plugin , it sends test email successfully, but it doesn't impact on Contact form 7 or other contact form plugins. I don't see any error on my browser Development Console. my email domain same as my site domain.

2) My server restricted php mail() function and I have to use SMTP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.