-
AuthorPosts
-
July 16, 2014 at 3:25 pm #292107
As described in various other topics in this forum, the form emails are not successfully sent under certain (mostly unknown) conditions. I’ve been fighting with this problem now as well. My setup is:
- Own hosted server with WP 3.9.1
- Enfold latest version
- WP-Mail-SMTP plugin v 0.9.5 set up to send via Zoho mail. Test mail is sent successfully
However, when I submit a form, I get an error stating the email was not sent. Now, email is not rocket science and the problem can easily be traced and resolved if I have a log available. I can’t find that however. Is there a log of send attempts being held on the wordpress server? Note: I don’t want to host my own mail server, since it carries too much maintenance.
If I change my smtp setting to send via gmail, it all works fine, so it clearly is something between the form and Zoho.
- This topic was modified 10 years, 4 months ago by lifeboy. Reason: Correct spelling
July 16, 2014 at 11:08 pm #292280Hi!
Have you looked for the PHP error_log file? normally its located in the root (/).
Cheers!
JosueJuly 17, 2014 at 11:44 am #292401I have turned on logging in /etc/php5/apache2/php.ini by enabling error_log = syslog and before that I had error_log = php_errors.log, but nothing is logged regardless of whether email can be sent from a form or not.
If while file is the email sending code?
July 17, 2014 at 5:28 pm #292571Check line 720 on /enfold/framework/php/class-form-generator.php
Cheers!
JosueJuly 17, 2014 at 6:21 pm #292596Thanks Josue,
The code is:
if($use_wpmail) { $header .= 'From: '. $from . " <".$from."> \r\n"; wp_mail($send_to_mail, $subject, $message, $header); } else { $header .= 'From:'. $from . " \r\n"; mail($send_to_mail, $subject, $message, $header); }
Now I have two questions: How can I add something in here to make this thing log what it tries to do, since it doesn’t send the mail?
Then, while were at this point:
The $header variable contains the $from strong (email address), but I want to it to also contain the address that the person entered in the form so that when I hit reply in the email that I receive from wordpress, the mail will be sent to the person that filled in the form. How can I add a “reply-to:” header in there and what is the variable that contains this address?
The php mail function has this example:
<?php $to = ' (Email address hidden if logged out) '; $subject = 'the subject'; $message = 'hello'; $headers = 'From: (Email address hidden if logged out) ' . "\r\n" . 'Reply-To: (Email address hidden if logged out) ' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?>
So in this example, how to I add the add the email address that the enquirer entered in the form as the reply-to address?
July 19, 2014 at 11:34 am #293325Hey!
Maybe this post will help you: https://kriesi.at/support/topic/contact-form-e-mails-not-being-sent-because-of-yahoos-new-dmarc-policy/
This fix is required if your host doesn’t allow you to send emails with a different top level domain from your server. Some server administrators block these emails because they want to avoid that the server is used for spam or scam mails.If you want to change the header and include a Reply-To code replace this code in /enfold/framework/php/class-form-generator.php:
$header .= 'From:'. $from . " \r\n";
with
$header .= 'From: (Email address hidden if logged out) '. " \r\n"; $header .= 'Reply-To: ' . $from . "\r\n";
and replace (Email address hidden if logged out) with your email address.
Best regards,
PeterMarch 31, 2017 at 2:32 am #769702Dude et al;
Yes, this is what needs to happen.Can the file ‘class-form-generator.php’ be copied to the daughter theme folder and mod’d or will it only function within the parent theme folder structure? (Don’t want to make the change and have it inadvertently overwritten on an update and cause the problem all over again.)
Enhancement Request: Ideally, the widget would automagically use the administrator email address for the site (Settings -> General: Email Address-field) as the “From:” and insert the viewer’s email as the “Reply-to:” to address the Yahoo issue. Are there any known issues/drawbacks with doing it this way?
Or would it be simpler to add “From:” & “Reply-To:” fields to the base widget, allowing per form control and updating the Help-doc regarding this issue?
I’m happy to build in a work-around for now. But, spam policies are only going to get tighter & tighter as the spammers figure out more & varied ways around this stuff.
TYIA for your help!
Cheers!
DarylApril 1, 2017 at 2:44 pm #770324Hi Daryi,
You can use WordPresses hooks and filters instead of modifying that class. Please refer to this thread for a possible solution.
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.