Viewing 24 posts - 1 through 24 (of 24 total)
  • Author
    Posts
  • #1046298

    I do face the same issue, which is already covered by numerous posts and the related discussions.
    In a couple of posts related to the same topic I found the following code proposed to solve the problem including the thumbs-up from the users that it actually worked:

    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;
    }

    I simply copy-pasted the code to the bottom of my Enfold Child functions.php in appearance > editor and replaced (Email address hidden if logged out) with my email account to which I would like to receive the messages from the contact form.
    However, when I added the code into the file I got plenty of “unexpected token” error messages for the first two lines of the code and a warning not to save the file .
    What do I need to do?

    #1047583

    Hey SpunkaneHill,
    Sorry for the late reply, I believe the error you received was from curly quotes, once I corrected them the code saved easily.
    Please try coping this code:

    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;
    }
    

    Best regards,
    Mike

    #1047601

    Hi Mike,
    no change, unfortunately still the same error messages for the firtst two lines with the modified code. Would it help if I send you a screen shot? How can I do that?
    Best regards
    Thorsten

    #1047725

    Hi,
    Perhaps it would be better to include a admin login in the Private Content area.
    But just so you know, you can add screenshots by uploading your images to a service such as postimages.org and pasting the html code given in your post.

    Best regards,
    Mike

    #1047795

    Hi Mike,
    I didn’t notice that there are two input areas in Design>Editor which need to be toggled. By mistake I tried to copy the code into style.css. No errors when I copy it into functions.php. Sorry for my stupidity!
    However, using the code didn’t solve my initial problem!
    Maybe it’s the wrong code for my purpose?
    What I want to do:
    I would like my potential clients to get in touch with me and send me an Email-Message to my business Email address by using the Contact Form. And I need to see who sent me the Email to be able to respond.
    What I did and what happened:
    Put my business Email address in the first input field of the form in Enfold as the target for the clients Emails.
    Wrote a test message on my web page as a dummy client, using my private AOL Email address as an input into the field “E-Mail”
    Got an error message from the host of my business domain – and my business email-, that due to AOL’s DMARC policy they are not allowed to forward the Email because the AOL address has be changed to webmaster@my_business_domain. The error message is being sent sometimes, hoever with most trials nothing happens at all.
    Tried the code

    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;
    }

    and replaced (Email address hidden if logged out) with my business Email address. No Message went through to my business inbox.
    Is the code the right one to achieve what I want to achieve or what else to use?
    Best regards
    Thorsten

    #1048026

    Hi,
    For your purpose you will not need to make any changes to your contact form,
    First, your email address should in the “Your email address” field of the form so you will get the message:
    2018-12-20-215738
    Then, when your visitor fills out the form with their email address, it will be in the “from” field, so you will see who sent it and when you reply it will go to them.

    The reason you were getting the error was because you were faking your own email to yourself, and it was AOL.
    But the problem was going to be that when you replied to the message, it was going back to you, because your address was in the “from” field, not your visitor.
    So please don’t use the function.

    I hope I explained this well.

    Best regards,
    Mike

    #1048115

    Hi Mike,
    I think I have done exactly what you are describing in your response. But maybe not, let’s see.
    I do not understand your comment about “faking your own email to yourself” actually.
    Pls find all the steps and details in the Private Content.
    Where did I make a mistake? Hope you are able to help me. Thx.
    Best regards
    Thorsten

    #1048126

    I hope the following links work better:

    #1048186

    Hi,
    Oh I see what you are doing now, I wonder if Strato is going to send you an error message for every web mail provider? Please try testing with @gmail.com, @yahoo.com, @hotmail.com, etc.
    If they are going to do this with with all of them, then you will have to use the function with your own site email address and when you get a message you will have to copy the visitor email from the body of the message.
    If Strato is only going to do this to AOL emails, then you could think about putting a message on your site “AOL addresses not supported” I have seen this many times for Yahoo addresses.

    If you use the function you may also need to set up a SMTP Server to Send WordPress Emails with, so that you can get emails with your business email in the “from” field.

    Best regards,
    Mike

    #1048231

    Hi Mike,
    we’re getting closer.
    Using my business email address works, i.e. not blocked by domain’s host, no error message, email is going through.
    Could you help me with a code that would do the following with the contact form input data before sending it out as an email:
    1. Copy the client’s email address from the Email input element to a dumb text element that’s called Email or Sender or From, whatever … and include this into the message, so to let me know the clients Email address so that I can get in touch with him later
    2. Replace the client’s email address from the E-Mail input element by a variable that I may define in the code, I would use for example my business Email address for this, because I know it goes through
    Would you think that would work to solve my problem?
    Best regards
    Thorsten

    #1048477

    Hi,
    For question 1: your email message from your form should already be formatted this way, for example this is the body of a contact form email I sent to myself, please note that the visitor email is listed as “E-Mail”

    
    Name: Mike <br/>
    E-Mail:  (Email address hidden if logged out)  <br/> <br/>
    Message: Please send me more info on the demo <br/> <br/>

    For question 2: To assign the “from” address to yours that does work, please use this function in your functions.php:

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

    just change ” (Email address hidden if logged out) ” to your email, and the body of the message will still have the email that the visitor enters into the form. Like above.
    Please test.

    Best regards,
    Mike

    #1048514

    Hi Mark,
    I am facing a very strage behaviour now.
    I added the code to the functions.php and changed “ (Email address hidden if logged out) ” to my business email.
    Now, if I send a message from my Android smartphone with the AOL-email address, it works, emails goes through, sender is my business email and the AOL-email address shows up in the body of the message. Perfect, the code does what I want it to do.
    However, if I send a message from either my Windows laptop or my Windows desktop no email pops up regardless if I type the AOL-email into the form or my business-email. If I then delete the code again from the functions.php and type my business email into the contact form no email goes through from either laptop or desktop, and that definitely did work last night before I got the code.
    Any idea what may cause that?
    Best regards
    Thorsten

    #1048528

    Hi Mike,
    I found the reason for the strange behaviour. It has nothing to do with the device or with the email address:
    With your code if I send out a message from any device where I have newly opened my web page, the message goes through with any email address. If I just refresh/reload the contact page and try to send out a second message it does not work. If I close my web page completely and open it again, I can send out the next message, but again just one message, no second message. Close and open my webpage, one message and so on.
    Is there a chance to adjust the code so that multiple messages would work without having to close the webpage? Potential clients would not know this workarround!
    Best regards
    Thorsten

    #1048538

    Hi,
    I tried to recreate this on a new install on my localhost, by filling out the contact form, sending, & refreshing & filling out again. But the contact form worked. I then tested yours, please see link in Private Content area, and I received the successful message each time. I looked for page errors but didn’t find any, Can you please include a admin login in the private content area so we can take a closer look.

    Best regards,
    Mike

    #1048796

    Hi Mike,
    I received to messages from your yesterday’s trials: test and test1
    I did some further test on my side today with the following results:
    On my Smart Phone:
    Message 1, refresh , Message 2 => both messages go through, no issue
    On a desktop PC (another one than I used for the tests yesterday, even another location and another network!, same browser as with my tests on laptop and desktop yesterday, i.e. firefox):
    Message 1 goes through => I receive a confirmation on my contact page “Deine Nachricht wurde versendet” , refresh the contact page in my browser – firefox!,
    Message 2 does not go through, I do not receive a confirmation on my contact page, the message does not pop up in my inbox
    delete my web page in the browser, repeat the complete exercise => same result!
    On the same desktop, but with Microsoft Edge as a browser this time
    Everything works perfect, no issue, same as on the SmartPhone!
    So it seems to be an inconsitency with Firefox.
    Pls let me know if you would still need admin access.
    Best regards
    Thorsten

    #1048870

    Hi,
    Thanks for sharing your test results, it would appear that the issue is with the Firefox browser, but I don’t see a solution to correct the behavior of a browser that is not following the standard.
    Do you believe that it would be common for Firefox users to send two messages without reloading the page?
    Perhaps a solution would be to include a statement in the success message to reload the browser before sending a second message?
    Perhaps this could only show to Firefox users
    Or to reload the browser automatically after X seconds, or redirect to the homepage which would force users to reload by having to go to the contact page again?
    I guess I would only need admin access if you want to try one of these solutions.

    Best regards,
    Mike

    #1050557

    Yes, it looks like a Firefox thing. Crome also worked well without any issues!
    I think redirect to the homepage which would force users to reload by having to go to the contact page again would be a good workaround. How would I do that? Would I need a coding (function.php?) for that?

    #1050598

    Hi,
    Please edit your contact form and look for the option:
    What should happen once the form gets sent?” near the bottom, and choose “redirect user to another page”
    then choose “Page” and your homepage.
    2019-01-06-114003

    Best regards,
    Mike

    #1050689

    Hi Mike,
    Yes that works well, but I can only either display a message on the page, e.g. “Your message has been sent”, or redirect. If I use “redirect” and I want to send a confirmation email to my client it does not work because of the coding I added in the function.php (refer to your message #1048477 above). The email does not go to the clients address he typed into the form, but to my business email address. Is it possible to modify the coding in such a way that a) the client’s message goes throught to my business address and b) my automatic confirmation goes to the clients email address?
    Best regards
    Thorsten

    #1051242

    Hi,
    That would not be as easy as it sounds and creates another place for errors to occur.
    How about creating a “Thank you” page that displays the “Your message has been sent” this way you can use the redirect and have the message?
    As a bonus you can include other targeted information on the page just for these customers.

    Best regards,
    Mike

    #1051337

    Hi Mike,
    that sounds like a good workaround, I will do that.
    Thx for your patience helping me to sort out the isse issue with a good result.
    Best regards
    Thorsten

    #1051381

    Hi,
    We are happy to help, it sounds like we can close this topic, but I like to ask to be sure :)

    Best regards,
    Mike

    #1051382

    Hi Mike,
    yes, we can close it. Thx once again.
    Best regards
    Thorsten

    #1051388

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)

    Best regards,
    Mike

Viewing 24 posts - 1 through 24 (of 24 total)
  • The topic ‘Contact form: Email rejected due to AOL's DMARC policy’ is closed to new replies.