Index: branches/RC/core/kernel/utility/email_send.php =================================================================== diff -u -r11319 -r11347 --- branches/RC/core/kernel/utility/email_send.php (.../email_send.php) (revision 11319) +++ branches/RC/core/kernel/utility/email_send.php (.../email_send.php) (revision 11347) @@ -1100,6 +1100,7 @@ $this->SetReturnPath($from_email); } + $to_email = $this->_replaceRecipientEmail($to_email); $this->SetEncodedEmailHeader('To', $to_email, $to_name ? $to_name : $to_email); return $this->Deliver(); @@ -1807,11 +1808,34 @@ */ function AddTo($email, $first_last_name = '', $last_name = '') { + $email = $this->_replaceRecipientEmail($email); + $name = rtrim($first_last_name.' '.$last_name, ' '); $this->AddRecipient('To', $email, $name); } /** + * Allows to replace recipient in all sent emails (used for debugging) + * + * @param string $email + * @return string + */ + function _replaceRecipientEmail($email) + { + if (defined('DBG_EMAIL') && DBG_EMAIL) { + if (substr(DBG_EMAIL, 0, 1) == '@') { + // domain + $email = str_replace('@', '_at_', $email) . DBG_EMAIL; + } + else { + $email = DBG_EMAIL; + } + } + + return $email; + } + + /** * Adds one more recipient into "Cc" header * * @param string $email