Smtp
Smtp class handles mail via SMTP.
Class methods
Method | Description | Available from version |
---|---|---|
__construct | SMTP client constructor. | |
__destruct | Destructor, closes connection when destroying an object. | |
connect | Establishes connection via SMTP. | |
authenticate | Authenticates at SMTP server. | |
getErrors | Returns all SMTP client errors. |
Example
// Creates class instance and calls its methods $client = new Mail\Smtp( $this->host, $this->port, ('smtps' === $this->protocol || ('smtp' !== $this->protocol && 465 === $this->port)), true, $this->login, $this->password ); if (!$client->authenticate($error)) { $errors = $client->getErrors(); return false; }
© «Bitrix24», 2001-2024