- Edited
Two suggestions for class.email.php. Additions in red below.
The first one ensures that special characters appear correctly when being used in the subject of an email message. Head_charset needs to be set to utf-8 explicitly.
The second one is an alert when the system falls back to standard PHP email. It would be even better to display this message on the screen instead of just putting it in the error log of the website.
Consequences of this fall back are severe:
- multipart messages become a mess
- char encoding is a mess
regards,
Jan-Willem Arnold
near line 175:
$options=array('head_encoding' => 'quoted-printable',
'text_encoding' => 'quoted-printable',
'html_encoding' => 'base64',
'head_charset' => 'utf-8',
'html_charset' => 'utf-8',
'text_charset' => 'utf-8');
near line: 200
if($smtp){ //Send via SMTP
$mail = mail:('smtp',
array ('host' => $smtp,
'port' => $smtp,
'auth' => $smtp?true,
'username' => $smtp,
'password' => $smtp,
'timeout' =>20,
'debug' => false,
));
$result = $mail->send($to, $headers, $body);
if(!PEAR:($result))
return true;
$alert=sprintf("Unable to email via %s:%d \n\n%s\n",$smtp,$smtp,$smtp,$result->getMessage());
Sys:(LOG_ALERT,'SMTP Error',$alert,false);
//print_r($result);
} else {
error_log("SMTP settings for mail account not valid or missing, falling back to standard php mail. Update settings in admin panel.", 0);
}