<p>As mentioned in the comments, this is likely an email configuration issue and Brad's comment should be taken to heart:</p>

<blockquote>
  <p>both sendmail and PHP's mail are notoriously unreliable and shouldn't be used in production environments</p>
</blockquote>

<p>Craft should not be treating user emails differently than non-user emails and Sprout Forms isn't doing anything unique when it sends notification emails, it's just piggybacking on what Craft is doing.</p>

<p>Sending your email through a service like Mailgun (or any similar service) will give you more visibility into what's happening and what you may need to troubleshoot. <a href="https://sprout.barrelstrengthdesign.com/craft-plugins/email" rel="nofollow noreferrer">Sprout Email</a> has a Sent Email Element Type that you can enable to help troubleshoot some email deliverability issues on the Craft side of things.</p>

<p>For two good overviews on troubleshooting email errors in Craft, see:</p>

<ul>
<li><a href="https://craftcms.com/support/troubleshooting-email-errors" rel="nofollow noreferrer">https://craftcms.com/support/troubleshooting-email-errors</a> - <em>Craft Docs</em></li>
<li><a href="https://straightupcraft.com/events/troubleshooting-and-debugging-errors-in-php" rel="nofollow noreferrer">Troubleshooting and debugging errors in PHP</a> - <em>Straight Up Craft</em></li>
</ul>

<hr>

<p>Another direction to consider when troubleshooting an error like this may be to look closer at the <code>From</code> headers and what emails you are sending to. Is it really just Craft Emails vs non-Craft Emails or could there be other patterns? For example, maybe the emails that aren't being received are all <code>gmail</code> addresses. In some cases, if you are sending to a <code>gmail</code> address you own from a <code>gmail</code> address you own, Google may suppress the email from appearing in your inbox.</p>

CC BY-SA 3.0
2017-05-08T21:44:35.593Z
Thanks @Ben. I looked for other patterns but did not find any. The other domains were a range of domains, including non-Google app domains. The clincher for me was that I could take any of the affected addresses (any of website domain, Gmail, Google app email, hoster ISP domain, and NZ's biggest ISP), and in each case I could make them a Craft user email and the email would fail (with log error), or remove them from Craft user email and email would be delivered.
Jack McKenzie
CC BY-SA 3.0
2017-05-06T16:24:27.207Z
2017-05-06T16:24:27.207Z
Ben Parizek
<p>Are the craft users' e-mail addresses on the same domain as the hosting is running? I've ran into the issue before that the server just "delivers" the e-mail to the local hosting.</p>

<p>For example if your site is running on example.com:</p>

<p>user1@example2.com - goes through<br>
user2@example.com - doesn't go through - gets "delivered" to local server's inbox</p>

CC BY-SA 3.0
2017-05-08T21:38:59.830Z
Thanks @Rias. In this case the Craft users email addresses where both of the same domain and a range of other domains, and the non-Craft users were also of the same and a range of other domains. That was in-fact my first reaction but I soon ruled it out as a pattern.
Jack McKenzie
CC BY-SA 3.0
2017-05-03T13:51:35.027Z
2017-05-03T13:51:35.027Z
Rias
<p>Is there anything in Sprout Forms or Craft that prevents an email being sent to any registered Craft user email address but not other email addresses not in the Craft user list? </p>

<p>I have a really simple one field form that sends a notification to two email addresses: the one in the submitted form field, as well as the one in the CP Sprout Forms notifications field. </p>

<p>A weird thing is happening. If I use an email address that is not belonging to a Craft user (either as the typed in notification address or the {email} one) the email is sent (according the server logs) and received. If I use an email address belonging to a  Craft user the email is not sent from Craft (doesn't even register in the server logs).</p>

<p>(The simple form is trying to distil the problem down - it is occurring on all my forms, and was working before but has stopped, possibly the same time as a server change. The PHP mail() function works to said email addresses. I am using latest versions of Craft and Sprout Forms on PHP 7.)</p>

<p>Edit: I can swap email addresses in and out of the user list so when they belong to a user no email is sent, and when they are removed from the user list, the email is sent. This suggests there is nothing wrong with the email address per se or the route through the system, but purely the fact that it is a Craft user email address.</p>

<p>Edit2: When sending to a craft user email address the following craft.log error is made:
Email error: Could not execute: /bin/mini_sendmail (etc)
This doesn't happen when a non-craft user email is used. So suggests to me Sendmail is not properly set up (but why then do other emails get through fine).</p>

CC BY-SA 3.0
2017-05-02T13:38:19.167Z
I would guess from your edits that this is a CraftCMS issue, as I haven't had this issue with Sprout Forms. Are you running the latest versions of Craft/Sprout? As an aside, have you dropped [Barrel Strength](https://sprout.barrelstrengthdesign.com/craft-plugins/request/support) or Pixel&Tonic a line? I assume you have, but always worth asking.
Joshua M
CC BY-SA 3.0
2017-05-03T05:25:29.210Z
Yes, I've more or less eliminated Sprout Forms from the equation by now. I have found that using SMTP mode with working service solves the problem all around. However I am still intrigued why the failure is only happening with Craft users. My vague assumption is that a different mechanism is used to send email to users compared to non-users, which seems a little unlikely. Yes, the latest versions as of two days ago are in place for both. I didn't ask Barrel Strength as I don't think it is a Sprout Forms problem given that the email Test from the Control panel also fails.
Jack McKenzie
CC BY-SA 3.0
2017-05-03T17:24:50.163Z
Can you reproduce this problem in another environment? I've had sendmail issues on more than one host, so my guess is you've got a server-specific issue—and it could be _working_ fine but extend to sending policies and other stuff that's a pain to troubleshoot. If SMTP (Mailgun, Sparkpost, SendGrid) is an option, it'd be a great way to get around the problem and avoid relying on a server's sendmail implementation. You might also consider detailing your Craft mail settings in the question, along with some environment info.
Matt Stein
CC BY-SA 3.0
2017-05-03T19:11:44.853Z
Sounds like a sendmail configuration issue to me. FWIW, both sendmail and PHP's mail are notoriously unreliable and shouldn't be used in production environments.
Brad Bell
CC BY-SA 3.0
2017-05-08T21:47:54.137Z
Thanks @Matt and Brad. I could not reproduce this in another environment. In the end I have taken your suggestions and used SMTP (without issues), and will be converting all my websites that use sendmail or PHP mail to SMTP. I think there are benefits beyond just getting the email "out of the server" as mentioned.
Jack McKenzie
<emails><plugin-sproutforms>
Sprout Forms or Craft not sending email to Craft user email addresses
# Sprout Forms or Craft not sending email to Craft user email addresses

(Asked by: username_0 on 2017-04-28)

Is there anything in Sprout Forms or Craft that prevents an email being sent to any registered Craft user email address but not other email addresses not in the Craft user list?

I have a really simple one field form that sends a notification to two email addresses: the one in the submitted form field, as well as the one in the CP Sprout Forms notifications field.

A weird thing is happening. If I use an email address that is not belonging to a Craft user (either as the typed in notification address or the {email} one) the email is sent (according the server logs) and received. If I use an email address belonging to a Craft user the email is not sent from Craft (doesn't even register in the server logs).

(The simple form is trying to distil the problem down - it is occurring on all my forms, and was working before but has stopped, possibly the same time as a server change. The PHP mail() function works to said email addresses. I am using latest versions of Craft and Sprout Forms on PHP 7.)

Edit: I can swap email addresses in and out of the user list so when they belong to a user no email is sent, and when they are removed from the user list, the email is sent. This suggests there is nothing wrong with the email address per se or the route through the system, but purely the fact that it is a Craft user email address.

Edit2: When sending to a craft user email address the following craft.log error is made:
Email error: Could not execute: /bin/mini\_sendmail (etc)
This doesn't happen when a non-craft user email is used. So suggests to me Sendmail is not properly set up (but why then do other emails get through fine).

**Tags:** emails, plugin-sproutforms

> **Comments:**
> **username_1**: I would guess from your edits that this is a CraftCMS issue, as I haven't had this issue with Sprout Forms. Are you running the latest versions of Craft/Sprout? As an aside, have you dropped [Barrel Strength](https://sprout.barrelstrengthdesign.com/craft-plugins/request/support) or Pixel&Tonic a line? I assume you have, but always worth asking.  
> **username_0**: Yes, I've more or less eliminated Sprout Forms from the equation by now. I have found that using SMTP mode with working service solves the problem all around. However I am still intrigued why the failure is only happening with Craft users. My vague assumption is that a different mechanism is used to send email to users compared to non-users, which seems a little unlikely. Yes, the latest versions as of two days ago are in place for both. I didn't ask Barrel Strength as I don't think it is a Sprout Forms problem given that the email Test from the Control panel also fails.  
> **username_2**: Can you reproduce this problem in another environment? I've had sendmail issues on more than one host, so my guess is you've got a server-specific issue—and it could be _working_ fine but extend to sending policies and other stuff that's a pain to troubleshoot. If SMTP (Mailgun, Sparkpost, SendGrid) is an option, it'd be a great way to get around the problem and avoid relying on a server's sendmail implementation. You might also consider detailing your Craft mail settings in the question, along with some environment info.  
> **username_3**: Sounds like a sendmail configuration issue to me. FWIW, both sendmail and PHP's mail are notoriously unreliable and shouldn't be used in production environments.  
> **username_0**: Thanks @Matt and Brad. I could not reproduce this in another environment. In the end I have taken your suggestions and used SMTP (without issues), and will be converting all my websites that use sendmail or PHP mail to SMTP. I think there are benefits beyond just getting the email "out of the server" as mentioned.  

---

## 2 answers

### Answer by username_4 on 2017-05-06. Score: 2 | Accepted answer

As mentioned in the comments, this is likely an email configuration issue and Brad's comment should be taken to heart:

> both sendmail and PHP's mail are notoriously unreliable and shouldn't be used in production environments

Craft should not be treating user emails differently than non-user emails and Sprout Forms isn't doing anything unique when it sends notification emails, it's just piggybacking on what Craft is doing.

Sending your email through a service like Mailgun (or any similar service) will give you more visibility into what's happening and what you may need to troubleshoot. [Sprout Email](https://sprout.barrelstrengthdesign.com/craft-plugins/email) has a Sent Email Element Type that you can enable to help troubleshoot some email deliverability issues on the Craft side of things.

For two good overviews on troubleshooting email errors in Craft, see:

* <https://craftcms.com/support/troubleshooting-email-errors> - *Craft Docs*
* [Troubleshooting and debugging errors in PHP](https://straightupcraft.com/events/troubleshooting-and-debugging-errors-in-php) - *Straight Up Craft*

---

Another direction to consider when troubleshooting an error like this may be to look closer at the `From` headers and what emails you are sending to. Is it really just Craft Emails vs non-Craft Emails or could there be other patterns? For example, maybe the emails that aren't being received are all `gmail` addresses. In some cases, if you are sending to a `gmail` address you own from a `gmail` address you own, Google may suppress the email from appearing in your inbox.

> **Comments:**
> **username_0**: Thanks @Ben. I looked for other patterns but did not find any. The other domains were a range of domains, including non-Google app domains. The clincher for me was that I could take any of the affected addresses (any of website domain, Gmail, Google app email, hoster ISP domain, and NZ's biggest ISP), and in each case I could make them a Craft user email and the email would fail (with log error), or remove them from Craft user email and email would be delivered.  

---

### Answer by username_5 on 2017-05-03. Score: 1

Are the craft users' e-mail addresses on the same domain as the hosting is running? I've ran into the issue before that the server just "delivers" the e-mail to the local hosting.

For example if your site is running on example.com:

user1@example2.com - goes through  
user2@example.com - doesn't go through - gets "delivered" to local server's inbox

> **Comments:**
> **username_0**: Thanks @username_5. In this case the Craft users email addresses where both of the same domain and a range of other domains, and the non-Craft users were also of the same and a range of other domains. That was in-fact my first reaction but I soon ruled it out as a pattern.  

---

