Problem with accented characters in Send Mail step

Testing a server action which sends emails, I received this in my email program:

image

The corresponding step in the Send Mail step is:

image

Is there some setting or option I’ve missed?

A bit more information is required, do you use NodeJS, PHP or ASP? Where is the problem with the accented characters, in the mail title or body? Is mail being sent as text or HTML?

I’m using PHP. The problem is the recipient details (as entered in the ‘RECIPIENT(S) - To Name’ field as in the screenshot above). In the body of the email, accents appear correctly. The mail was sent as text, but it doesn’t make any difference if I select HTML.

Try to edit the file dmxConnectLib/modules/mail.php.

Find following code at line 46:

        $options->from = $options->fromName != ''
            ? '"' . $options->fromName . '" <' . $options->fromEmail . '>'
            : $options->fromEmail;

        $options->to = $options->toName != ''
            ? '"' . $options->toName . '" <' . $options->toEmail . '>'
            : $options->toEmail;

Change it to:

        $options->from = $options->fromName != ''
            ? mb_encode_mimeheader($options->fromName, "UTF-8", "Q") . ' <' . $options->fromEmail . '>'
            : $options->fromEmail;

        $options->to = $options->toName != ''
            ? mb_encode_mimeheader($options->toName, "UTF-8", "Q") . ' <' . $options->toEmail . '>'
            : $options->toEmail;

Let me know if it fixes the issue.

Great - it has indeed fixed it. Will this be included in the next/future update?

Would have to check first if it would not cause other issues, but I don’t expect any problems. So probably we could include it in the next update.

1 Like

Seems that it was actually a bug in the HtmlMimeMail module that we used, it should encode all the headers which it didn’t. Here the updated file, the changes in dmxConnectLib/modules/mail.php should not be needed.

File should be placed in dmxConnectLib/lib.
HtmlMimeMail.zip (6.1 KB)

I think there is a problem using this file. I’ve tried several times and in each case there are no errors in the console, but the email is not delivered. Looking at the undelivered message on the server, I see:

X-PHP-Originating-Script: 33221:HtmlMimeMail.php\n MIME-Version: 1.0: missing or malformed local part (expected word or “<”)

This address has been ignored. There were no other addresses in your
message, and so no attempt at delivery was possible.

Then I better reverse it and use the solution I gave you earlier. The HtmlMimeMail is a very old library that isn’t up-to-date anymore. I will leave the HtmlMimeMail as it is and apply the changes in the mail.php.

Fine. I’ll go back to the first solution.