• Resolved Wasilij

    (@wasilij)


    Hi,
    I am using your plugin with pleasure and I like it very much 🙂 Thank you for that plugin!

    I have a problem with the filter user_registration_modify_user_email_header. It is intended to be used to modify the E-Mail headers before sending an E-Mail. I want to remove the Reply-To header because my Webserver is thinking that the registration E-Mail coming to the admin is a spam due to that header.

    So in functions.php I put that code:

    add_action( 'plugins_loaded', function() {
    // Plugin: User Registration & Membership: modify email header: remove ReplyTo
    add_filter( 'user_registration_modify_user_email_header', 'my_user_registration_modify_user_email_header', 70, 3 );
    } );
    function my_user_registration_modify_user_email_header( $headers, $sender_email, $sender_name ) {
    $new_headers = [];
    foreach ( $headers as $header ) {
    if ( strpos( $header, 'Reply-To:' ) === FALSE ) {
    $new_headers[] = $header;
    continue;
    }
    }
    return $new_headers;
    }

    The problem is that this code is never executed. I made some error_log outputs in that function and I do not get some output in the debug.log. And when I register a new user on my website, then the E-Mails come to the admin still have the header “Reply-To”.

    I also put some error_log in your original method UR_Emailer::ur_get_header() (includes/class-ur-emailer.php) to check, if something happens there, but still I get no output in the debug.log.

    Is there another way the E-Mails are sent with? Can you maybe give me some hints how to accomplish that? Thank you in advance!
    Wasilij

    I use the following:
    – PHP v8.1 (apache)
    – WP v6.8.3
    – Plugin v4.4.4

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author wpeverest

    (@wpeverest)

    Hi Wasilij,

    Regarding the filter not taking effect, we will have our dev look into this and get back to you.

    In the meantime, could you please provide more details about this statement? Why is that header information causing the email to be flagged as spam?

    I want to remove the Reply-To header because my Webserver is thinking that the registration E-Mail coming to the admin is a spam due to that header.

    Thread Starter Wasilij

    (@wasilij)

    Hi @wpeverest,

    thank you for the quick reply.

    Some of the mail servers have their own heuristic methods to detect spam. And so far as I know and I had also many experiences with my provider for my and customers projects: If the sender (my server/website) is another E-Mail address that the Reply-To address, then this will be seen as a potential spam. My website sends E-Mails from [email protected] and the user is registering on my website is using [email protected] address. So From ≠ Reply-To => SPAM

    Furthermore, the probability increases to be detected as spam when the E-Mail does not contain alternative text body and uses only HTML like the registration E-Mail is sent by this plugin. The Content-Type is only text/html; charset=UTF-8. I guess this has also an impact.

    Another thing why the E-Mail is seen as spam could be the exclamation mark in the subject. But this is not the case here, because I know from other customers projects, where we use a form plugin (like WS Forms lite) that an E-Mail is detected as spam as soon as we setup the Reply-To attribute to the form submission action/event/settings. It is very comfortable when you receive a message from the contact form and you just hit reply in your E-Mail client and you can directly write back to the sender. But very very often that messages from the sender are marked as spam due to the Reply-To address of the sender.

    I hope I explained it well and you can understand more.

    Best,
    Wasilij

    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @wasilij,

    Thank you so much for your detailed explanation and for sharing your experience about how some mail servers handle the From and Reply To headers. You’ve described it very clearly, and your points make complete sense.

    You are right that many email providers use strict spam filters that may flag messages when the From and Reply To addresses are different, especially if SPF, DKIM, or DMARC records are not properly aligned. As you mentioned, having only an HTML email without a plain text version can also increase the chance of it being marked as spam.

    Your feedback is very helpful and will guide us as we review our email handling process. We’ll also discuss with our development team how we can make improvements in this area.

    We truly appreciate the time and effort you put into explaining this. Your input is valuable and helps us improve the plugin’s reliability and email deliverability.

    Best regards,

    Thread Starter Wasilij

    (@wasilij)

    Hi @shresthauzwal,

    no problem. Fine that you think about a solution 🙂

    I think the easiest way would be providing an option in the settings where you can enter (or leave blank) the Replay-To E-Mail address. And if someone enters an address, then it would be used in your code to apply when sending the mails… it should be easy done 😉

    Wish you success,
    Wasilij

    Plugin Support Amrit Kumar Shrestha

    (@shresthauzwal)

    Hi @wasilij,

    That’s a great suggestion! 😊

    We understand that having the ability to set a custom Reply-To email address would make a big difference for reducing spam detection issues and improving email replies. I’ll forward this feature request to our development team so they can consider adding it in a future update.

    For now, you can continue using the plugin with the default settings, and we’ll keep you posted if this option becomes available. This will help ensure outgoing emails are handled more reliably while keeping your setup smooth.

    Best Regards!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Remove Reply-To from E-Mail headers’ is closed to new replies.