# Cannot send emails (An exception occurred while executing 'INSERT INTO page\_redirects)

**URL:** <https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [December 16, 2021, 12:31am UTC](https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034 "2021-12-16T00:31:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nickbm/32/6488_2.png) [@nickbm](https://forum.mautic.org/u/nickbm)\
**Post date:** [December 16, 2021, 12:31am UTC](https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034/1 "2021-12-16T00:31:19Z")

</div>

**Your software**  
My Mautic version is: 4.1.0  
My PHP version is: 7.4.27  
My Database type and version is: MySQL (mysqli) 8,.0.27

**Your problem**  
My problem is: Cannot send emails, getting sql related error

These errors are showing in the log:

```auto
[2021-12-16 02:27:43] mautic.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\DriverException: "An exception occurred while executing 'INSERT INTO page_redirects (is_published, date_added, created_by, created_by_user, date_modified, modified_by, modified_by_user, checked_out, checked_out_by, checked_out_by_user, redirect_id, url, hits, unique_hits) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [1, "2021-12-16 00:27:43", 1, "Nikos Lykakis", null, null, null, null, null, null, "4a5e3dad01994acab728b06bd", "\x68\x74\x74\x70\x73\x3a\x2f\x2f\x77\x77\x77\x2e\x62\x6f\x75\x72\x64\x65\x6c\x61\x2e\x63\x6f\x6d\x2f\x5d\xce\xa3\xcf\x5f\xce\xbd\xce\xb4\xce\xb5\xcf\x83\xce\xb7\x2f", 0, 0]: Incorrect string value: '\xCF_\xCE\xBD\xCE\xB4...' for column 'url' at row 1" at D:\inetpub\vhosts\ *****.com\wwwroot\m.*****.com\public\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php line 128 {"exception":"[object] (Doctrine\\DBAL\\Exception\\DriverException(code: 0): An exception occurred while executing 'INSERT INTO page_redirects (is_published, date_added, created_by, created_by_user, date_modified, modified_by, modified_by_user, checked_out, checked_out_by, checked_out_by_user, redirect_id, url, hits, unique_hits) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [1, \"2021-12-16 00:27:43\", 1, \"Nikos Lykakis\", null, null, null, null, null, null, \"4a5e3dad01994acab728b06bd\", \"\\x68\\x74\\x74\\x70\\x73\\x3a\\x2f\\x2f\\x77\\x77\\x77\\x2e\\x62\\x6f\\x75\\x72\\x64\\x65\\x6c\\x61\\x2e\\x63\\x6f\\x6d\\x2f\\x5d\\xce\\xa3\\xcf\\x5f\\xce\\xbd\\xce\\xb4\\xce\\xb5\\xcf\\x83\\xce\\xb7\\x2f\", 0, 0]:\n\nIncorrect string value: '\\xCF_\\xCE\\xBD\\xCE\\xB4...' for column 'url' at row 1 at D:\\inetpub\\vhosts\\ *****.com\\wwwroot\\m.*****.com\\public\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\AbstractMySQLDriver.php:128, Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\StatementError(code: 0): Incorrect string value: '\\xCF_\\xCE\\xBD\\xCE\\xB4...' for column 'url' at row 1 at D:\\inetpub\\vhosts\\ *****.com\\wwwroot\\m.*****.com\\public\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\Mysqli\\Exception\\StatementError.php:19)"} []

```

Steps I have tried to fix the problem:

I have tried switching between mysql\_pdo and mysqli but didn not help.  
Weirdly, switching to PHP8 solved this particular problem (but created others, as php8 is not yet supported by mautic)

---

<div class="post-metadata">

**Author:** ![nickbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nickbm/32/6488_2.png) [@nickbm](https://forum.mautic.org/u/nickbm)\
**Post date:** [December 16, 2021, 10:51am UTC](https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034/2 "2021-12-16T10:51:26Z")

</div>

I have tried to track this down.

I believe this is indeed a bug, because when I try another email, it works.

It’s something on that particular email that creates the problem.

The email that hits the problem is in Greek, it has several links in it, and it also have an image.

Please help.

---

<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:** [December 16, 2021, 12:23pm UTC](https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034/3 "2021-12-16T12:23:53Z")

</div>

> [@nickbm](#):
>
> `Incorrect string value: '\\xCF_\\xCE\\xBD\\xCE\\xB4`

Hi,  
I think the issue is here:

> Incorrect string value: '\xCF\_\xCE\xBD\xCE\xB4

What is the URL you added to the link in the email? Any weird characters?

---

<div class="post-metadata">

**Author:** ![nickbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nickbm/32/6488_2.png) [@nickbm](https://forum.mautic.org/u/nickbm)\
**Post date:** [December 16, 2021, 12:58pm UTC](https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034/4 "2021-12-16T12:58:40Z")

</div>

HI,

I just checked all links in that email. There are no weird characters, are links are in the .com/category/post/ format.

If you want i can give you access to my Mautic installation so that you can debug it.

Thank you

---

<div class="post-metadata">

**Author:** ![nickbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nickbm/32/6488_2.png) [@nickbm](https://forum.mautic.org/u/nickbm)\
**Post date:** [December 16, 2021, 1:20pm UTC](https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034/5 "2021-12-16T13:20:45Z")

</div>

Also, the “Send example” function works fine.

---

<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:** [December 16, 2021, 1:33pm UTC](https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034/6 "2021-12-16T13:33:45Z")

</div>

Send example won’t create certain fields.  
Can you plz remove all links and see what happens?

---

<div class="post-metadata">

**Author:** ![nickbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nickbm/32/6488_2.png) [@nickbm](https://forum.mautic.org/u/nickbm)\
**Post date:** [December 16, 2021, 2:05pm UTC](https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034/7 "2021-12-16T14:05:37Z")

</div>

This exists on the plain text version of the email, and looks suspicious:

`Domain.com [https://www.domain.com/]Σύνδεση/Εγγραφή`

---

<div class="post-metadata">

**Author:** ![nickbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nickbm/32/6488_2.png) [@nickbm](https://forum.mautic.org/u/nickbm)\
**Post date:** [December 16, 2021, 2:07pm UTC](https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034/8 "2021-12-16T14:07:58Z")

</div>

Yes, that was the problem.

---

<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:** [December 16, 2021, 2:58pm UTC](https://forum.mautic.org/t/cannot-send-emails-an-exception-occurred-while-executing-insert-into-page-redirects/22034/9 "2021-12-16T14:58:31Z")

</div>

So the hunch was good, I’m happy you found it.
