Bitrix API

Mailer extends PHPMailer

Table of Contents

Constants

KEEP_ALIVE_ALWAYS  = 'keep_alive_always'
KEEP_ALIVE_NONE  = 'keep_alive_none'
KEEP_ALIVE_OPTIONAL  = 'keep_alive_optional'

Methods

checkConnect()  : bool
Returns true if Login, Password and Server parameters is right Returns false if any errors in connection was detected
closeConnections()  : void
Closes all instances connections
getInstance()  : Mailer|null
Returns instance of current class
prepareConfiguration()  : bool
Prepare PHPMailer configuration from bitrix/.settings.php
sendMailBySmtp()  : bool
Send mail via smtp connection
setMIMEBody()  : mixed
Set prepared MIME body data
setMIMEHeader()  : mixed
Set prepared MIME header

Constants

KEEP_ALIVE_ALWAYS

public mixed KEEP_ALIVE_ALWAYS = 'keep_alive_always'

KEEP_ALIVE_NONE

public mixed KEEP_ALIVE_NONE = 'keep_alive_none'

KEEP_ALIVE_OPTIONAL

public mixed KEEP_ALIVE_OPTIONAL = 'keep_alive_optional'

Methods

checkConnect()

Returns true if Login, Password and Server parameters is right Returns false if any errors in connection was detected

public static checkConnect(Context $context, ErrorCollection $errors) : bool
Parameters
$context : Context
$errors : ErrorCollection
Tags
throws
Exception
Return values
bool

closeConnections()

Closes all instances connections

public static closeConnections() : void

getInstance()

Returns instance of current class

public static getInstance(Context $context) : Mailer|null
Parameters
$context : Context
Tags
throws
ArgumentException
throws
Exception
Return values
Mailer|null

prepareConfiguration()

Prepare PHPMailer configuration from bitrix/.settings.php

public prepareConfiguration(Context $context) : bool
Parameters
$context : Context
Return values
bool

sendMailBySmtp()

Send mail via smtp connection

public sendMailBySmtp(string $sourceTo, string $subject, string $message, string $additional_headers, string $additional_parameters) : bool
Parameters
$sourceTo : string
$subject : string
$message : string
$additional_headers : string
$additional_parameters : string
Tags
throws
Exception
Return values
bool

setMIMEBody()

Set prepared MIME body data

public setMIMEBody(mixed $body) : mixed
Parameters
$body : mixed

setMIMEHeader()

Set prepared MIME header

public setMIMEHeader(mixed $headers) : mixed
Parameters
$headers : mixed

        
On this page

Search results