Add SMTP error output in error messages, add new language string, as per sf patch: https://sourceforge.net/tracker2/?func=detail&aid=1800644&group_id=26031&atid=385709

This commit is contained in:
Marcus Bointon 2008-11-20 22:20:37 +00:00
parent 5aeead7e70
commit e570ea0524
1 changed files with 18 additions and 13 deletions

View File

@ -687,19 +687,20 @@ class PHPMailer {
function SetLanguage($lang_type = 'en', $lang_path = 'language/') {
if( !(@include $lang_path.'phpmailer.lang-'.$lang_type.'.php') ) {
$PHPMAILER_LANG = array();
$PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' .
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
$PHPMAILER_LANG["execute"] = 'Could not execute: ';
$PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.';
$PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.';
$PHPMAILER_LANG["from_failed"] = 'The following From address failed: ';
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' .
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.';
$PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.';
$PHPMAILER_LANG["file_access"] = 'Could not access file: ';
$PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: ';
$PHPMAILER_LANG["encoding"] = 'Unknown encoding: ';
$PHPMAILER_LANG["signing"] = 'Signing Error: ';
$PHPMAILER_LANG['provide_address'] = 'You must provide at least one recipient email address.';
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer is not supported.';
$PHPMAILER_LANG['execute'] = 'Could not execute: ';
$PHPMAILER_LANG['instantiate'] = 'Could not instantiate mail function.';
$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Could not authenticate.';
$PHPMAILER_LANG['from_failed'] = 'The following From address failed: ';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: The following ' .
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Data not accepted.';
$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Could not connect to SMTP host.';
$PHPMAILER_LANG['file_access'] = 'Could not access file: ';
$PHPMAILER_LANG['file_open'] = 'File Error: Could not open file: ';
$PHPMAILER_LANG['encoding'] = 'Unknown encoding: ';
$PHPMAILER_LANG['signing'] = 'Signing Error: ';
$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
}
$this->language = $PHPMAILER_LANG;
return true;
@ -1682,12 +1683,16 @@ class PHPMailer {
/**
* Adds the error message to the error container.
* Also gets SMTP error if there is one
* Returns void.
* @access private
* @return void
*/
private function SetError($msg) {
$this->error_count++;
if ($this->Mailer == 'smtp' and !empty($this->smtp->error['smtp_msg'])) {
$msg .= '<p>' . $this->Lang('smtp_error') . $this->smtp->error['smtp_msg'] . "</p>\n";
}
$this->ErrorInfo = $msg;
}