public function PHPMailer::send

5.x PHPMailer.php public PHPMailer::send()

Create a message and send it. Uses the sending method specified by $Mailer.

Return value

bool false on error - See the ErrorInfo property for details of the error

Throws

Exception

File

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

Class

PHPMailer
PHPMailer - PHP email creation and transport class.

Namespace

PHPMailer\PHPMailer

Code

public function send() 
 {
  try {
    if (!$this->preSend()) {
      return false;
    }

    return $this->postSend();
  }
  catch (Exception $exc) {
    $this->mailHeader = '';
    $this->setError($exc->getMessage());
    if ($this->exceptions) {
      throw $exc;
    }

    return false;
  }
}