Welcome Guest, Not a member yet? Register   Sign In
scandinavian letters in mail header

[eluser]MgM Web[/eluser]
I have been seeing some errors while sending mail using the default CI mail component.
It is possible to encode the body of the mail but not the header, or at least I have not found any good method to do so.

When I send emails with scandinavian letters in the subject field, these letters (æøå) is shown as ??? in my inbox.

Until now I have not found any good fix for this but then i came over "mb_encode_mimeheader()".

I edited the "Email.php" core library file to this:

function subject($subject)
        $subject = mb_encode_mimeheader($subject); //Added encoding
        if (strpos($subject, "\r") !== FALSE OR strpos($subject, "\n") !== FALSE)
            $subject = str_replace(array("\r\n", "\r", "\n"), '', $subject);            

        if (strpos($subject, "\t"))
            $subject = str_replace("\t", ' ', $subject);

        $this->_set_header('Subject', trim($subject));

And now my scandinavian letters are showing as expected. Maybe this can be of help to others with the same problem. Or is there better ways to accomplish this?

Theme © iAndrew 2016 - Forum software by © MyBB