# API not sending emails to existing contacts

**URL:** <https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690>\
**Category:** Mautic 6 Install/Upgrade Support\
**Created:** [May 20, 2025, 7:46am UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690 "2025-05-20T07:46:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![criskolkman01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/criskolkman01/32/13424_2.png) [@criskolkman01](https://forum.mautic.org/u/criskolkman01)\
**Post date:** [May 20, 2025, 7:46am UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/1 "2025-05-20T07:46:51Z")

</div>

I don’t understand why this was being closed as not being a bug, but that’s probably just me… 🙂  
[API not sending emails to existing contacts · Issue #14957 · mautic/mautic](https://github.com/mautic/mautic/issues/14957)

This used to work fine with older Mautic installation but doesn’t work correct with Mautic 6.0.0 anymore:

### Mautic Series

6.0.x series

### Mautic installed version

6.0.0

### Way of installing

I downloaded a release from [Mautic Releases - Mautic](https://www.mautic.org/mautic-releases)

### PHP version

8.2.21

### What browsers are you seeing the problem on?

_No response_

### What happened?

We are using the Mautic API to send emails to our users.  
One of the emails we send is when a user account is being created, the user should get 2 emails, 1 with their username + instructions and 1 with their password.

In our script we check if a contact with that email exists.

NO: → Create a new contact, send the email(s), delete the contact  
YES: - \>Send the email(s)

**The issue we’re running into now:**  
Keeping the new user account above as an example (should get 2 emails).

**Contact does NOT exist within Mautic**

- Contact is being created by our script (works fine)
- First email with username and instructions is being sent (works fine and also see it in **Reports)**
- Second email with password is being sent (this does **NOT** work, also do not see the email in **Reports** )
- Contact is being deleted by our script (works fine)

**Contact DOES exist within Mautic**

- First email with username and instructions is being sent (this does **NOT** work, also do not see the email in **Reports** )
- Second email with password is being sent (this does **NOT** work, also do not see the email in **Reports** )

We had an older instance of Mautic (version 4.4.7) and it was working fine there.

### How can we reproduce this issue?

Step 1: Sent an email through the API using an existing contact

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 21, 2025, 11:28am UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/2 "2025-05-21T11:28:43Z")

</div>

Would be interesting to see the API call to understand. Also if you have any errors, that helps.

---

<div class="post-metadata">

**Author:** ![criskolkman01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/criskolkman01/32/13424_2.png) [@criskolkman01](https://forum.mautic.org/u/criskolkman01)\
**Post date:** [June 10, 2025, 7:56am UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/3 "2025-06-10T07:56:31Z")

</div>

Hello, sorry for the late reply but I was sick.

I cannot share the code, but it’s a very simple Powershell script which used to work fine.  
The API call being done:

```auto
        $EmailUsername = "$MailUri/4/contact/$Contact_ID/send"
        --SOME LOGGING HERE--
        $Body = @{
            tokens = @{
                -- 2 TOKENS HERE TO DEFINE EMAIL SUBJECT AND BODY --
            }
            assetAttachments = @{
                attachment_one = 1
            }
        }
    
        $Parameters = @{
            Method = "POST"
            Uri = $EmailUsername
            Headers = $Header
            Body = ($Body | ConvertTo-Json)
            ContentType = "application/json"
        }
        
        Try {
            Invoke-RestMethod @Parameters
            --SOME LOGGING HERE--
        }
        Catch {
            --SOME LOGGING HERE--
            Exit 1
        }

```

There is no error at all, Mautic is reporting the email to be sent out while it’s not.  
Like I said in the original post, if a new contact is being created the contact gets one email (should get two) and when a contact already exists, the contact gets none (should get two).

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 10, 2025, 8:15am UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/4 "2025-06-10T08:15:22Z")

</div>

Hi,  
next steps to troubleshoot this:

1. Reponse  
Do you get a json ‘{ “success”: 1 }’ response?

2. Can you check if the contact is not DNC you are trying to send? (Red icon next to the name). It happens often that you try with some dummy email, it bounces and can’t send email to the same person again

3. Is there a setting in your Mautic at Email Settings \> Frequency - max 1 email / day?

Joey

---

<div class="post-metadata">

**Author:** ![criskolkman01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/criskolkman01/32/13424_2.png) [@criskolkman01](https://forum.mautic.org/u/criskolkman01)\
**Post date:** [June 18, 2025, 6:41am UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/5 "2025-06-18T06:41:18Z")

</div>

1: Yes  
2: No  
3: No

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 18, 2025, 2:19pm UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/6 "2025-06-18T14:19:57Z")

</div>

Is it possible, that password has special characters that crashes your script?  
Joey

---

<div class="post-metadata">

**Author:** ![criskolkman01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/criskolkman01/32/13424_2.png) [@criskolkman01](https://forum.mautic.org/u/criskolkman01)\
**Post date:** [June 25, 2025, 8:37am UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/7 "2025-06-25T08:37:17Z")

</div>

No the script runs fine, we also get the response from Mautic that the emails have been sent, but they just do not get sent out.

---

<div class="post-metadata">

**Author:** ![tomfriedhof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tomfriedhof/32/14195_2.png) [@tomfriedhof](https://forum.mautic.org/u/tomfriedhof)\
**Post date:** [July 5, 2025, 9:38pm UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/8 "2025-07-05T21:38:16Z")

</div>

I ran into this issue as well. I tracked the issue down to this code that was added in Mautic 6 [MAUT-12048 : Check if a segment email was already sent to a given con… · mautic/mautic@78b2359 · GitHub](https://github.com/mautic/mautic/commit/78b2359eb76c84aea6fa5219c42c254f70b1891a#diff-09b3ad8df265e6fc5d43a0ead1c0d5394e085e56093f39af644b641d52827d82)

Essentially the API endpoint is now enforcing that emails of type `list` are only allowed to be sent once per contact. If you want to send an email to a contact more than once you will need to change the `email_type` in the database to “template”.

---

<div class="post-metadata">

**Author:** ![criskolkman01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/criskolkman01/32/13424_2.png) [@criskolkman01](https://forum.mautic.org/u/criskolkman01)\
**Post date:** [July 7, 2025, 6:54am UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/9 "2025-07-07T06:54:52Z")

</div>

Thank you for your response, it makes sense if that is the issue tbh!  
Is there any way to change it in the GUI? Would be kinda crazy if that’s not an option ngl, I dunno what I should change in the DB itself.

---

<div class="post-metadata">

**Author:** ![criskolkman01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/criskolkman01/32/13424_2.png) [@criskolkman01](https://forum.mautic.org/u/criskolkman01)\
**Post date:** [July 7, 2025, 9:07am UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/10 "2025-07-07T09:07:54Z")

</div>

I changed this and this **seems** to be the fix, thank you!!

---

<div class="post-metadata">

**Author:** ![criskolkman01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/criskolkman01/32/13424_2.png) [@criskolkman01](https://forum.mautic.org/u/criskolkman01)\
**Post date:** [July 7, 2025, 10:07am UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/11 "2025-07-07T10:07:33Z")

</div>

Doesn’t seem to be any option in the GUI to change this, which is a bit crazy ngl.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [July 8, 2025, 10:08pm UTC](https://forum.mautic.org/t/api-not-sending-emails-to-existing-contacts/35690/12 "2025-07-08T22:08:28Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
