function SetLanguage($langcode = 'en', $lang_path = 'language/') {
    //Define full set of translatable strings
    $PHPMAILER_LANG = array(
      'provide_address' => 'You must provide at least one recipient email address.',
      'mailer_not_supported' => ' mailer is not supported.',
      'execute' => 'Could not execute: ',
      'instantiate' => 'Could not instantiate mail function.',
      'authenticate' => 'SMTP Error: Could not authenticate.',
      'from_failed' => 'The following From address failed: ',
      'recipients_failed' => 'SMTP Error: The following recipients failed: ',
      'data_not_accepted' => 'SMTP Error: Data not accepted.',
      'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
      'file_access' => 'Could not access file: ',
      'file_open' => 'File Error: Could not open file: ',
      'encoding' => 'Unknown encoding: ',
      'signing' => 'Signing Error: ',
      'smtp_error' => 'SMTP server error: ',
      'empty_message' => 'Message body empty',
      'invalid_address' => 'Invalid address',
      'variable_set' => 'Cannot set or reset variable: '
    );
    //Overwrite language-specific strings. This way we'll never have missing translations - no more "language string failed to load"!
    $l = true;
    if ($langcode != 'en') { //There is no English translation file
      $l = @include $lang_path.'phpmailer.lang-'.$langcode.'.php';
    }
    $this->language = $PHPMAILER_LANG;
    return ($l == true); //Returns false if language not found
  }这个是phpmailer中的一个方法,,,
我的问题是:怎么把phpmailer里SetLanguage里的$PHPMAILER_LANG数组里的内容,在浏览器运行有发邮件功能php文件时,在浏览器里不显示$PHPMAILER_LANG数组里的内容啊。(前提:发送的邮件格式不正确)急啊,,请大师指教

解决方案 »

  1.   

    printr(数组);查看下,如果没有出来就是语法有问题
      

  2.   

    我意思是上面我粘贴的那个方法,是phpmailer里的一个方法,,,发送邮件时,如果格式不对,不在浏览器中显示$PHPMAILER_LANG数组里的内容的任何相应的内容。并且没有写页面,只写一个php文件,,
      

  3.   

    就是,写了一个发送邮件的类,名称为thanks.php。然后再这个类中引入了phpmailer的所有文件和方法。用下面这个地址进行访问发送邮件。
    http://127.0.0.1/cbmail/thanks.php如果thanks.php里写的邮件地址格式不正确的话,访问http://127.0.0.1/cbmail/thanks.php这个地址的网页会出现SetLanguage方法里的$PHPMAILER_LANG数组里的一些内容。比如,You must provide at least one recipient email address.这句话。
    并且SetLanguage方法是phpmailer文件夹里的class.phpmailer.php类里的一个方法
    如何修改class.phpmailer.php类,使得访问http://127.0.0.1/cbmail/thanks.php这个地址的网页不会出现SetLanguage方法里的$PHPMAILER_LANG数组里的一些内容。比如,You must provide at least one recipient email address.这句话。不知道有没有表达清楚嗯,,,希望大家帮忙啊
      

  4.   

    不知道是不是phpmailer哪里trigger_error了,你@抑制一下吧。