add error information from class.smtp.php

add $this->smtp->getError() to the throw new phpmailerException
This commit is contained in:
Yoshi Sakai 2013-01-12 14:29:59 +09:00
parent a4b456e69d
commit f0b4e35438
2 changed files with 4 additions and 2 deletions

View File

@ -965,7 +965,8 @@ class PHPMailer {
} }
$smtp_from = ($this->Sender == '') ? $this->From : $this->Sender; $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
if(!$this->smtp->Mail($smtp_from)) { if(!$this->smtp->Mail($smtp_from)) {
throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL); $this->SetError($this->Lang('from_failed') .$smtp_from . "<br />" .implode("<br />",$this->smtp->getError())) ;
throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL);
} }
// Attempt to send attach all recipients // Attempt to send attach all recipients

View File

@ -3,6 +3,7 @@
* PHPMailer language file: refer to English translation for definitive list * PHPMailer language file: refer to English translation for definitive list
* Japanese Version * Japanese Version
* By Mitsuhiro Yoshida - http://mitstek.com/ * By Mitsuhiro Yoshida - http://mitstek.com/
* Modified by Yoshi Sakai - http://bluemooninc.jp/
*/ */
$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。'; $PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。';
@ -13,7 +14,7 @@ $PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';
$PHPMAILER_LANG['execute'] = '実行できませんでした: '; $PHPMAILER_LANG['execute'] = '実行できませんでした: ';
$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: '; $PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';
$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: '; $PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';
$PHPMAILER_LANG['from_failed'] = '次のFromアドレスに間違いがあります: '; $PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: ';
$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。'; $PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。';
//$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: '; //$PHPMAILER_LANG['invalid_address'] = 'Not sending, email address is invalid: ';
$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。'; $PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';