WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] Parameter -f mail@mydomain.it (4 posts)

  1. Annadf63
    Member
    Posted 1 year ago #

    Hi..sorry for my english.
    I have a big problem. I don't receive email sent by contact form..
    I have asked support at my hosting (Tophost) and it have reply that I must insert this command: "-f mail@miodominio.it" into plugin's php. Because they block the email sent by contact form..!! How and where i can insert this command?? thank you..

    http://wordpress.org/plugins/contact-form-7/

  2. loru88
    Member
    Posted 9 months ago #

    Hi
    I recently had your same problem with tophost and contact form
    the problem is from tophost, it blocks every mail sent without that parameter.
    I have resolved by hacking the wordpress core:
    open wp-includes/class-phpmailer.php
    search the line with
    public $Sender = '';
    at about line 97, this is an empty string, put your email instead and save the changement.
    now you will receive email, phpmailer automatically set the -f parameter when this string is not empty

    would be great to put a hook filter to control the value of that variable because at every wordpress upgrade you have to rewrite your email

  3. Annadf63
    Member
    Posted 9 months ago #

    Oooooohhhh!!! Thank youuuu!! Great solution!!

    I am very happy!!.. :D

  4. loru88
    Member
    Posted 9 months ago #

    I just found a better solution, it doesn't need to hack core

    add_action('phpmailer_init', function($phpmailer){
    	$phpmailer->Sender = $phpmailer->From;
    });

    place it in your functions.php :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic