public function PHPMailer::postSend

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

Actually send a message via the selected mechanism.

Return value

bool

Throws

Exception

1 call to PHPMailer::postSend()
PHPMailer::send in inc/PHPMailer/src/PHPMailer.php
Create a message and send it. Uses the sending method specified by $Mailer.

File

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

Class

PHPMailer
PHPMailer - PHP email creation and transport class.

Namespace

PHPMailer\PHPMailer

Code

public function postSend() 
 {
  try {
    // Choose the mailer and send through it
    switch ($this->Mailer) {
      case 'sendmail':
      case 'qmail':
        return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody);
      case 'smtp':
        return $this->smtpSend($this->MIMEHeader, $this->MIMEBody);
      case 'mail':
        return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
      default:
        $sendMethod = $this->Mailer . 'Send';
        if (method_exists($this, $sendMethod)) {
          return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody);
        }

        return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
    }
  }
  catch (Exception $exc) {
    $this->setError($exc->getMessage());
    $this->edebug($exc->getMessage());
    if ($this->exceptions) {
      throw $exc;
    }
  }

  return false;
}