protected function PHPMailer::lang

5.x PHPMailer.php protected PHPMailer::lang($key)

Get an error message in the current language.

Parameters

string $key:

Return value

string

18 calls to PHPMailer::lang()
PHPMailer::addAnAddress in inc/PHPMailer/src/PHPMailer.php
Add an address to one of the recipient arrays or to the ReplyTo array. Addresses that have been added already return false, but do not throw exceptions.
PHPMailer::addAttachment in inc/PHPMailer/src/PHPMailer.php
Add an attachment from a path on the filesystem. Never use a user-supplied path to a file! Returns false if the file could not be found or read. Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client. If you need to do that, fetch…
PHPMailer::addEmbeddedImage in inc/PHPMailer/src/PHPMailer.php
Add an embedded (inline) attachment from a file. This can include images, sounds, and just about any other document type. These differ from 'regular' attachments in that they are intended to be displayed inline with the message, not just…
PHPMailer::addOrEnqueueAnAddress in inc/PHPMailer/src/PHPMailer.php
Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still be modified after calling this function), addition of such…
PHPMailer::addStringAttachment in inc/PHPMailer/src/PHPMailer.php
Add a string or binary attachment (non-filesystem). This method can be used to attach ascii or binary data, such as a BLOB record from a database.

... See full list

File

inc/PHPMailer/src/PHPMailer.php, line 3787

Class

PHPMailer
PHPMailer - PHP email creation and transport class.

Namespace

PHPMailer\PHPMailer

Code

protected function lang($key) 
 {
  if (count($this->language) < 1) {
    $this->setLanguage('en'); // set the default language
  }

  if (array_key_exists($key, $this->language)) {
    if ('smtp_connect_failed' == $key) {
      //Include a link to troubleshooting docs on SMTP connection failure
      //this is by far the biggest cause of support questions
      //but it's usually not PHPMailer's fault.
      return $this->language [$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
    }

    return $this->language [$key];
  }

  //Return the key as a fallback
  return $key;
}