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
  }
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
  }
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 }
Sets the language for all class error messages.
Returns false if it cannot load the language file.  The default language is English.
@param string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br")
@param string $lang_path Path to the language file directory
@access public
Sets the language for all class error messages . Returns false if it cannot load the language file . The default language is English .