Bitrix API

Smtp

Table of Contents

Constants

ERR_AUTH  = 204
ERR_AUTH_MECH  = 205
ERR_CAPABILITY  = 203
ERR_COMMAND_REJECTED  = 202
ERR_COMMUNICATE  = 103
ERR_CONNECT  = 101
ERR_EMPTY_RESPONSE  = 104
ERR_REJECTED  = 102
ERR_STARTTLS  = 201

Methods

__construct()  : mixed
Smtp client constructor.
__destruct()  : void
Disconnects from the submission server.
authenticate()  : bool
Authenticate to the submission server.
connect()  : bool
Connect to the submission server.
decodeError()  : string
Returns error message by code.
getErrors()  : ErrorCollection
Returns all Smtp client errors.
setIsOauth()  : $this
Set flag is need to connect with OAuth

Constants

ERR_AUTH

public mixed ERR_AUTH = 204

ERR_AUTH_MECH

public mixed ERR_AUTH_MECH = 205

ERR_CAPABILITY

public mixed ERR_CAPABILITY = 203

ERR_COMMAND_REJECTED

public mixed ERR_COMMAND_REJECTED = 202

ERR_COMMUNICATE

public mixed ERR_COMMUNICATE = 103

ERR_CONNECT

public mixed ERR_CONNECT = 101

ERR_EMPTY_RESPONSE

public mixed ERR_EMPTY_RESPONSE = 104

ERR_REJECTED

public mixed ERR_REJECTED = 102

ERR_STARTTLS

public mixed ERR_STARTTLS = 201

Methods

__construct()

Smtp client constructor.

public __construct(string $host, string $port, string $tls, string $strict, string $login, string $password[, string|null $encoding = null ]) : mixed
Parameters
$host : string

Host.

$port : string

Port.

$tls : string

Tls.

$strict : string

Strict.

$login : string

Login.

$password : string

Password.

$encoding : string|null = null

. If null - current site encoding.

__destruct()

Disconnects from the submission server.

public __destruct() : void

authenticate()

Authenticate to the submission server.

public authenticate(array<string|int, mixed> &$error) : bool
Parameters
$error : array<string|int, mixed>

Will be filled with authentication errors.

Return values
bool

True if the authentication was successful, false - otherwise.

connect()

Connect to the submission server.

public connect(array<string|int, mixed> &$error) : bool
Parameters
$error : array<string|int, mixed>

Will be filled with connection errors.

Return values
bool

True if the connection was successful, false - otherwise.

decodeError()

Returns error message by code.

public static decodeError(int $code) : string
Parameters
$code : int

Error code.

Return values
string

setIsOauth()

Set flag is need to connect with OAuth

public setIsOauth(bool $value) : $this
Parameters
$value : bool
Return values
$this

        
On this page

Search results