Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #907614

    Hi,
    The Contact Form in Enfold is not working on my site. I have SMTP set up with an Amazon Web Services SES SMTP server. I am using the WP Mail SMTP plug-in. Test email sends fine from the WP Mail SMTP test email form.

    From the mail log (WP Mail Log plugin) I can see that the *Receiver* is always (Email address hidden if logged out) , but the *Sender* is the Email value in the Contact form. That WILL NOT WORK with Amazon SMTP and many if not most SMTP senders. The From value in SMTP is authenticated and only an authorized address is permitted to send through that SMTP gateway. So to use my SMTP gateway account, the FROM field MUST be (Email address hidden if logged out) ‘. The value that the user enters in the “Email” field should only be included as part of the *body* of the mail message. So for example if I fill out a form

    Name=Yeh Properties
    Email = (Email address hidden if logged out)
    Body= Hello world.

    I would need to have the following SMTP mail sent to me:

    =======
    FROM (Email address hidden if logged out)
    TO (Email address hidden if logged out)
    SUBJECT= New Message (sent by contact form at SYeh Design Portfolio)
    BODY=
    Name Field value was “Yeh Properties”
    Email Field value was ” (Email address hidden if logged out)
    =========

    Here’s a clip of the mail log showing that the “From” field is the field the user entered, not the field configured in WP Mail SMTP.

    Time
    Receiver
    Subject
    Message
    Headers
    Attachments
    Error
    2018-02-04 20:31:17 (Email address hidden if logged out) New Message (sent by contact form at SYeh Design Portfolio) View Content-type: text/html; charset=utf-8 From: (Email address hidden if logged out)
    2018-02-04 20:30:38 (Email address hidden if logged out) New Message (sent by contact form at SYeh Design Portfolio) View Content-type: text/html; charset=utf-8 From: (Email address hidden if logged out)
    2018-02-04 20:29:50 (Email address hidden if logged out) New Message (sent by contact form at SYeh Design Portfolio) View Content-type: text/html; charset=utf-8 From: (Email address hidden if logged out)

    The ONLY email that was successfully sent of these three was the one to ” (Email address hidden if logged out) ” because then both the sender and receiver were ” (Email address hidden if logged out) “. See Private Content for further info.

    #907626

    same here… must be the update cause mine use to work

    #907916

    Hi,
    Try adding this code to the end of your functions.php file in Appearance > Editor:

    add_filter('avf_form_from', 'avf_form_from_mod', 10, 3);
    function avf_form_from_mod($from, $new_post, $form_params) {
        $from = " (Email address hidden if logged out) ";
        return $from;
    }

    Adjust the from address

    Best regards,
    Mike

    #908263

    what does that do?

    do I change the ” (Email address hidden if logged out) ” with the actual email and keep the “” ???????

    #908268

    @merlinmedia – yes, you need to keep the double-quotes and replace the email with your actual one.

    Mike,

    Thanks, that works. I should emphasize that the file to edit is functions.php and not functions-enfold.php, just to clarify for others.

    Could I please request that this be made as a configurable option through the Enfold Theme Options. Something like Theme Options->Mail -> “Set sender to user-entered Email form field” YES/NO with NO being the default.

    As I mentioned most SMTP relay servers will NOT work the way Enfold is currently designed.

    Here is the text from the WP Mail SMTP plugin dialog:

    =====
    Mail
    From Email
    (Email address hidden if logged out)
    You can specify the email address that emails should be sent from.
    If you leave this blank, the default one will be used: (Email address hidden if logged out) .

    Please note if you are sending using an email provider (Gmail, Yahoo, Hotmail, Outlook.com, etc) this setting should be your email address for that account.
    =====

    Clearly WP Mail SMTP is indicating that the “From Email” should be the configured “From Email”, NOT the one the user enters. SMTP mail servers authenticate this way to avoid being hijacked by spammers.

    This is a major deficiency in Enfold currently.

    Will I need to re-edit functions.php when Enfold is updated?

    Thanks,
    Spencer

    #908270

    thanks. done and done but still no luck :(

    #908272

    Also… Am I correct that when Enfold does an update the code will be over written. would it not be more beneficial to place the code in the “Quick CSS” in the admin area. I would but I do not how to point the code to the function.php file lol.

    #908275

    @merlinmedia:

    Here’s the clip of the bottom of my new functions.php file just so you can see what it looks like when modified. I also had the question regarding overwriting when updating the theme.

    Just to make sure that this is the problem you should firm do a test email where you enter your own email into the Email field. That email should be delivered okay, as then both the sender and receiver are the same authenticate-able address. Are you using an SMTP plug-in?

    ——-

    /*
    * add option to edit elements via css class
    */
    // add_theme_support(‘avia_template_builder_custom_css’);

    add_filter(‘avf_form_from’, ‘avf_form_from_mod’, 10, 3);
    function avf_form_from_mod($from, $new_post, $form_params) {
    $from = ” (Email address hidden if logged out) “;
    return $from;
    }

    #908327

    Hi,

    @spencery2
    , glad to hear that the function solved. I recommend using a child theme and adding the function in the functions.php so the next update won’t interrupt service. I have reported this issue. Also thanks for your guidance to other users.


    @merlinmedia
    , this function must be placed in the functions.php, we recommend using a child theme.

    Best regards,
    Mike

    #908338

    Thanks for reporting this issue. I’ll check out the child theme approach.

    • This reply was modified 6 years, 9 months ago by spencery2.
    #908346

    Hi,
    Glad to hear, Let us know if you have further questions. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.