New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reply-to option for form emails to prevent failed emails #817

trevorgehman opened this Issue Jul 16, 2016 · 4 comments


None yet
3 participants

trevorgehman commented Jul 16, 2016

So, currently you can only specify the from and to fields when setting up form options. For contact forms, typically you want to just be able to reply to those emails.

What I've seen suggested is to change the from field to be: from: "{{ email }}", but this is actually bad practice and will cause issues for certain domains, one common example being

Due to the sender policy of, you'll likely run into delivery issues. For instance, Mailgun will refuse to deliver it:

Unauthenticated email from is not accepted due to domain's 5.7.1 DMARC policy. Please contact administrator of domain if 5.7.1 this was a legitimate mail. Please visit 5.7.1 to learn about DMARC 5.7.1 initiative.

I've seen this issue countless times in other form implementations. The solution is simple: keep the from email address set to your domain, and just add a reply-to field with the user-submitted email address.


This comment has been minimized.

trevorgehman commented Jul 16, 2016

Looks like this should be a very simple addition:

Just add this line to the SendEmail method of Statamic\Addons\Forms\FormListener:

if ($reply_to = array_get($config, 'reply_to')) {

And then in your email config you can set reply_to: "{{ email }}".


This comment has been minimized.

thestepafter commented Jul 19, 2016

Thanks @trevorgehman. I'm hoping that they put this into the core because I would rather not hack the core files.


This comment has been minimized.

trevorgehman commented Jul 19, 2016

@thestepafter Yes that is what needs to happen. Should be a simple addition, and IMO it belongs in the core.

If I get word that this won't be added, then creating a custom addon should be simple enough.


This comment has been minimized.


jasonvarga commented Jul 19, 2016

It will be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment