21293 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1657 Views |
-
Encoding problem with email subject line

7 March 2009 at 6:53am
Hi! Does anybody knows about the email function and the encoding problem?
I've got a problem with the encoding of the subject line of my send emails.
It's possible to send an email in utf-8. The body of the email is correctly encoded.
But it's not working for the "subject" header of the email. I'm receiving broken encoding.Something might be wrong with the email header.
Any idea?
-
Re: Encoding problem with email subject line

11 January 2010 at 11:20pm
Dear all,
I am having the same issue. I don't understand which encoding to use to send email subjects from Silverstripe.
As a temporary measure, I use the following function to remove most common French characters, but I would like to know how to proceed.
Warm regards,
Denis
function removeAccents($remove_from)
{
// Remove all instances of accents
$accent_array = array('e' => array('é','è','ê','ë'),
'E' => array('É','È','Ê','Ë'),
'a' => array('á','à ','â','ä','å'),
'A' => array('Ã','À','Â','Ä','Ã…'),
'i' => array('ï','ì','î'),
'I' => array('Ã','ÃŒ','ÃŽ'),
'o' => array('ö','ô','ò'),
'O' => array('Ö','Ô','Ò'),
'u' => array('ü','û','ù'),
'U' => array('Ü','Û','Ù')
);
foreach($accent_array as $acc_key => $acc_val_array)
{
$reg_exp_accent = '';// clear regular expression var
for($m=0;$m<count($acc_val_array);$m++)
{
$reg_exp_accent .= $acc_val_array[$m].'|';// create the regular expression var
}
$reg_exp_accent = substr_replace($reg_exp_accent,"",-1);// remove last '|'
$remove_from = ereg_replace($reg_exp_accent,$acc_key,$remove_from);
}
return $remove_from;
}
| 1657 Views | ||
|
Page:
1
|
Go to Top |


