# 4.2: Can't send email, error 500, foreign key constraint fails

**URL:** <https://forum.mautic.org/t/4-2-cant-send-email-error-500-foreign-key-constraint-fails/22933>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [March 6, 2022, 3:17am UTC](https://forum.mautic.org/t/4-2-cant-send-email-error-500-foreign-key-constraint-fails/22933 "2022-03-06T03:17:50Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![renatocron](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/renatocron/32/6936_2.png) [@renatocron](https://forum.mautic.org/u/renatocron)\
**Post date:** [March 29, 2022, 3:32pm UTC](https://forum.mautic.org/t/4-2-cant-send-email-error-500-foreign-key-constraint-fails/22933/9 "2022-03-29T15:32:12Z")

</div>

the table column on mauticemail\_stats is  
`copy_id` varchar(32) DEFAULT NULL,

and on mauticemail\_copies it’s defined as  
`id` varchar(32) COLLATE utf8mb4\_unicode\_ci NOT NULL,

so you need to make sure both tables are encoded with the same collation.

You need to convert all the tables into the same (preferability utf8mb4\_unicode\_ci) on all tables, there’s some other posts on this forum and github related to this issue. One issue you may face after trying to convert the columns to utf8mb4\_unicode\_ci, is that the index is bigger than what’s supported on mysql/mariadb, so you need to reduce the column from 255 to 191 chars

> <https://dba.stackexchange.com/questions/141149/wordpress-using-varchar255-for-index-with-innodb-and-utf8mb4-unicode-ci>

---

_[View the full topic](https://forum.mautic.org/t/4-2-cant-send-email-error-500-foreign-key-constraint-fails/22933)._
