Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • sorry to hear its not working, what email are you getting still? Is it the wordpress@yoursite.com email? If so try the 3rd option in cimy “Overwrite the sender only for the WordPress default “. I had to do this on our login site so the emails sent from the password reset wasnt from wordpress@mysite.com. Try that out. Im also assuming you disabled configure smtp?

    Update, I switched from Config SMTP to Cimy Swift SMTP http://wordpress.org/extend/plugins/cimy-swift-smtp/

    and theres an option in the settings
    “Never overwrite the sender:”

    make sure this is checkmarked.

    Once thats done everything worked.

    So the problem was with configure SMTP, don’t use that.

    NOTE: This is not a fix, but something I’ve been toying with, it may or may not work. Any suggestions or help would be appreciated.

    I’ve been playing around with a small hack into the code, I have to test still, and it has drawbacks but for what I have to do it might work.

    For my site, we are using CM7 for Contact Us, and need the “From” to be 100% the email the user puts in so our helpdesk can sort it properly.

    So what I did

    was in

    contact-form-7->includes->classes.php

    on approx line 400, you need to make the sender var global.

    global $sender;
    $sender = preg_replace_callback( $regex, $callback, $mail_template['sender'] );

    Then on around line 427
    add in 2 filters

    extract( $components );
    
                     //overide filter for "From" address
                    add_filter('wp_mail_from','cr_set_mail_from');
    		function cr_set_mail_from(){
                        global $sender;
                        return $sender;
    		}
    		add_filter('wp_mail_from_name','cr_set_mail_name');
    		function cr_set_mail_name(){
                        $blankness = '';
                        return $blankness;
                    }
    
    		$headers = "From: $sender\n";

    In order for this to work, on the CM7 options for the form “From” field, you have to use the email address only, you cannot include the name of the person or the <>, because the filter wp_mail_from only takes in an email. (so use [your-email] and not [your-name] <[your-email]>)
    so what the new filter does is override the “From” address with the email you set in the Form options, [your-email].

    I’ve only briefly tested it but will do more tomorrow, if you have a test server I highly suggest you test it out there first before doing anything.

    Im not sure but you might have to remove the filters after the mail is sent, but I’ve tried sending an email via another plugin and the filter does not seem to effect it (sending from the email set in configure smtp).

    Also note, if you use [your-name] <[your-email]> , you can use regular expressions to extract the [your-name] and [your-email] and then plug in the values to the functions the filters are calling, though there might be a lot to consider in creating that regular expression given the [your-name] field might have some weird things in it.

    Again this is just some toying with the plugin, I would appreciate any input or suggestions or even testing on your end.

    did anyone ever fix this problem? I have this issue. One way I can think of fixing this is to try and add some filters in the actual Contact Form 7 plugin code to manually set the From address. Has anyone tried this or have any other solution?

    Thread Starter dleung

    (@dleung)

    thanks for the response. You seem very dedicated to this plugin which is a good sign for the future. Plenty of time till March. Thanks again for the plugin and updates.

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