PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

BCC emails don't send on submit, but do send when you use Resend Notifications

  1. I have a form that is essentially, a "Refer a friend" form. Emails the submitter enters are populated into the BCC field in the notification settings. When I first tested the form, it worked when being submitted and every email got the notification.

    The next day, it no longer worked and no emails were sent to the BCC fields on submit. However, if you copy and paste the emails into "Resend Notifications" the emails do get sent.

    I didn't change, add or delete any plugins from the time the form worked to the next morning. We're looking into it with the host, but are there any possible issues you can see with Gravity Forms?

    Posted 8 years ago on Tuesday October 16, 2012 | Permalink
  2. Issues with email delivery are nearly always related to the machine sending the mail or the service on the other end providing the email to the user (Yahoo, Gmail, Live, Google Apps for your Domain, etc.) Gravity Forms hands off the email notifications immediately to the wp_mail() function. It's then up to your server to send it. Because Gravity Forms can make the notifications appear to come from any email address and any person (normally, the person submitting the form) the notifications will look like spam to a lot of email servers (for example, why is chris@rocketgenius.com sending email from yourwebsite.com domain?)

    That said, the most reliable way to ensure email delivery, and work around some of your host's email delivery restrictions, is to send the mail using an SMTP server, rather than your host's mail function. You can install and configure one of these plugins with an SMTP server of your choice:

    http://wordpress.org/extend/plugins/wp-mail-smtp/
    http://wordpress.org/extend/plugins/configure-smtp/
    http://wordpress.org/extend/plugins/cimy-swift-smtp/

    After you configure and test one of those plugins, please let us know if your email notifications are being delivered.

    It could also be a simple configuration error with the notifications, but from what you described that did not sound like the case.

    Posted 8 years ago on Wednesday October 17, 2012 | Permalink
  3. Thanks for the reply. After talking to my IT people, we do not believe this to be a hosting issue and it is not believed the SMTP server plugin is going to be the magic bullet here. To be clear, spam does not appear to be an issue for delivery. Every ISP we've tested delivers to the inbox. And because the email is delivered when we resend notifications, there is proof that Gravity Forms and the host are working correctly to deliver the email.

    Something I didn't mention the first time is that I had this problem before, then deleted and recreated the email fields on the form. After I did that, emails were being sent on submit. That worked for a day and then stopped the following day. Now that the form has been live, I don't want to delete and recreate.

    I have this feeling it could have to do with the merge tags in the BCC entry in notifications. If the emails send when using Resend Notifications and the actual email is entered, that tells me it might just not be getting the emails correctly.

    Posted 8 years ago on Wednesday October 17, 2012 | Permalink
  4. I've asked the developers for their input on this one. Thank you for the additional debug information.

    Posted 8 years ago on Thursday October 18, 2012 | Permalink
  5. Can you please export your form and email it to chris@rocketgenius.com - I would like to test this on my server to see if it's related to our code or a mail delivery problem.

    You can export the form by going to the Forms menu, Import/Export submenu and then the top center menu link, "Export Forms". Select this one form, save the XML file, and attach that to an email to me. Thank you.

    Posted 8 years ago on Friday October 19, 2012 | Permalink
  6. Chris, I was just curious if you ever had a chance to look at the file that I sent you. The immediate need to get this fixed has passed, but I'd still like to get to the bottom of it for future reference.

    Posted 8 years ago on Tuesday October 30, 2012 | Permalink
  7. I did install it and got sidetracked during testing. I did not receive any of the BCC emails myself either. I'm not sure why it's doing it, but instead of putting all those merge tags in the BCC area of the user notification (I wonder what happens when there is no email address entered in a field? Then the string is just a bunch of commas?) I would recommend using the gform_pre_submission_filter to add all the BCC. The example on this page shows doing exactly this:

    http://www.gravityhelp.com/documentation/page/Gform_pre_submission_filter

    However, that is for the administrator notification. Change this line:

    [php]
    $form["notification"]["bcc"] = $bcc;

    to

    [php]
    $form["autoResponder"]["bcc"] = $bcc;

    The user notification is referred to as the autoResponder.

    Try this and see if this works reliably. To avoid the problem you have now, with a string of commas, I would test the field to be sure it has an email address before adding it to the $bcc here.

    Posted 7 years ago on Wednesday October 31, 2012 | Permalink
  8. Thanks for response. I will test this at some point in the future when we need the functionality again. This will help. Thanks again.

    Posted 7 years ago on Friday November 9, 2012 | Permalink