Custom Module error when sending email (special character)

Custom Module error when sending email (special character)

I've created a custom module in CRM. We send emails from it. Most users get an error message when trying to send an email, saying there's a special character on the "recipient's email address".

The records are named as follows: "SD: 'Opportunity name' ". There's a colon in there. I'm guessing that's the special character, and when composing the email, the Contact Name is replaced by the SD record name, as you can see in the attached image.

Now, sometimes the SD record has 2 email addresses associated, and when we create a new email and select both email addresses, the Contact Name changes, and it doesn't display the colon anymore. When this happens, the users don't get any errors.

I believe this is a bug, but maybe I'm missing something.