Nous avons vu plusieurs sujets concernant l'encodage des caractères accentués.
Pour palier à ce problème et afin d'éviter la modification de multiple fichiers, on peut simplement modifier la class "mail" situé dans ce répertoire
system/library/mail.php.
Chercher ces lignes :
- Code: Tout sélectionner
public function setTo($to) {
$this->to = $to;
}
public function setFrom($from) {
$this->from = $from;
}
public function setSender($sender) {
$this->sender = html_entity_decode($sender, ENT_QUOTES, 'UTF-8');
}
public function setSubject($subject) {
$this->subject = html_entity_decode($subject, ENT_QUOTES, 'UTF-8');
}
public function setText($text) {
$this->text = $text;
}
public function setHtml($html) {
$this->html = $html;
}
public function addAttachment($file, $filename = '') {
if (!$filename) {
$filename = basename($file);
}
$this->attachments[] = array(
'filename' => $filename,
'file' => $file
);
}
Et les remplacer par celles-ci :
- Code: Tout sélectionner
public function setTo($to) {
$this->to = html_entity_decode($to, ENT_NOQUOTES, 'UTF-8');
}
public function setFrom($from) {
$this->from = html_entity_decode($from, ENT_NOQUOTES, 'UTF-8');
}
public function setSender($sender) {
$this->sender = html_entity_decode($sender, ENT_NOQUOTES, 'UTF-8');
}
public function setSubject($subject) {
$this->subject = html_entity_decode($subject, ENT_NOQUOTES, 'UTF-8');
}
public function setText($text) {
$this->text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');
}
public function setHtml($html) {
$this->html = html_entity_decode($html, ENT_NOQUOTES, 'UTF-8');
}
public function addAttachment($file, $filename = '') {
if (!$filename) {
$filename = basename($file);
}
$this->attachments[] = array(
'filename' => html_entity_decode($filename, ENT_NOQUOTES, 'UTF-8'),
'file' => html_entity_decode($file, ENT_NOQUOTES, 'UTF-8')
);
}