diff --git a/class.phpmailer.php b/class.phpmailer.php index 0fc3be4b..cc9925e1 100644 --- a/class.phpmailer.php +++ b/class.phpmailer.php @@ -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 .= '
' . $this->Lang('smtp_error') . $this->smtp->error['smtp_msg'] . "
\n"; + } $this->ErrorInfo = $msg; }