• hi,
    i had busy day today as on one of my client’s wordpress website was having issues with emails being sent out from wordpress, plugins, contact forms.

    there were no errors on any plugin or error_log. all showed emails being sent with true status.
    after that i started checking php mail function and it worked without any issue and this time i received the email.
    after talking to support, sending emails multiple times they were unable to help as they said everything was ok on their end.
    so i took to wordpress core files to check if i can find something.
    after checking for almost 2 hours found the issue to be caused by $header variable being used in phpmailer and if i replaced it with static headers for html mail the email started working again.

    so, now i am confused with how to fix the header issue so it works when a plugin sends headers for like cc or bcc and is this a bug or possible issue due to hosting setup?

    Server is linux and hosting provider is GoDaddy

    Thank You
    Raj

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter rajneeshrana88

    (@rajneeshrana88)

    yes i did checked this earlier.
    issue is fixed if i change $header in class.phpmailer.php to standard html email headers or nothing. it does not throw any error with default code but emails are never received on any host.

    I’m having the same issue on a customer site hosted at GoDaddy with Linux hosting. Their support has been unable to resolve the issue.

    I created a simple test file that used PHP’s standard mail() function and it was sent successfully and received. However, adding any headers into the test cause the send to be successful, but the email was never received.

    The headers I set for the test were a from name and from address that was an active email account with the same domain name.

    I tried the WP-Mail-SMTP plugin with several variations of from name, from address, and return path, all using PHP mail() to send the emails. None of these worked.

    Any other suggestions?

    Thread Starter rajneeshrana88

    (@rajneeshrana88)

    hi @aaron
    Did you try using html email headers from php manual?
    http://php.net/manual/en/function.mail.php try using headers from this page and make changes in class.phpmailer.php file.

    Thank You
    Raj

    Hi @raj

    Yes, I tried the php mail() function both with and without headers. Both tests returned true. The test without headers was received. The test with headers was never received.

    I don’t want to make changes to the class.phpmailer.php file because I’d have to make them each time WordPress has an update. And, in general I need a solution that can be done without editing the WordPress core.

    Other possibilities?

    Thank You

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp_mail issue, not receiving emails. issue being caused by headers in phpmailer’ is closed to new replies.