There’s a
thread in the General Support forum about problems sending mails from the manager. If high ASCII characters are used, the output is garbled.
I found a solution by modifying save_user.processor.php, making use of the phpmailer class. The funciton sendMailMessage (Line 455) needs to be replaced by this modified version:
// Send an email to the user
function sendMailMessage($email, $uid, $pwd, $ufn) {
global $signupemail_message;
global $emailsubject, $emailsender;
global $site_name, $site_start, $site_url;
global $modx;
$manager_url = $site_url . "manager/";
$message = sprintf($signupemail_message, $uid, $pwd); // use old method
// replace placeholders
$message = str_replace("[+uid+]", $uid, $message);
$message = str_replace("[+pwd+]", $pwd, $message);
$message = str_replace("[+ufn+]", $ufn, $message);
$message = str_replace("[+sname+]", $site_name, $message);
$message = str_replace("[+saddr+]", $emailsender, $message);
$message = str_replace("[+semail+]", $emailsender, $message);
$message = str_replace("[+surl+]", $manager_url, $message);
# include PHP Mailer
include_once "../manager/includes/controls/class.phpmailer.php";
# send form
$mail = new PHPMailer();
$mail->IsMail();
$mail->CharSet = $modx->config['modx_charset'];
$mail->AddAddress($email);
$mail->From = $emailsender;
$mail->FromName = $site_name;
$mail->Subject = $emailsubject;
$mail->Body = $message;
if(!$mail->send()) {
webAlert('An Error occurred: ' . $mail->ErrorInfo);
exit;
}
}
Adding that header information also makes it less likely those mails get caught in spam filters. The function is checking now for the charset as defined in the manager, adjusting it in case it’s not utf8.