Documentation

Core_Mail_Smtp extends Core_Mail
in package

SMTP driver

Tags
subpackage

Core\Mail

version
7.x
author

Hostmake LLC

copyright

© 2005-2024 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru

Table of Contents

Properties

$_bound  : string
Boundary
$_chunklen  : string
The chunk length.
$_config  : array<string|int, mixed>
List of parameters
$_contentType  : string
Mail Content-Type
$_files  : array<string|int, mixed>
List of attached files
$_fp  : mixed
Stream
$_from  : string
Mail FROM field
$_headers  : array<string|int, mixed>
List of headers
$_log  : mixed
$_message  : string
Message text
$_multipartRelated  : bool
Multipart related mode
$_recipientName  : string
Recipient name
$_senderName  : string
Sender name
$_separator  : string
Separator
$_status  : string
Status
$_subject  : string
Subject
$_to  : string
Mail TO field

Methods

__construct()  : mixed
Constructor.
attach()  : mixed
Attach file
bound()  : self
Set boundary
chunklen()  : self
Set chunk length
clear()  : self
Clear object
config()  : self
Set parameters
contentType()  : self
Set content type
from()  : self
Set sender address
getFrom()  : string
Get sender address
getLog()  : null|string
Get log
getMessage()  : string
Get message
getSeparator()  : string
Get separator
getServerHostname()  : string
Get server hostname
getStatus()  : bool
Get status
getSubject()  : string
Get subject
getTo()  : string
Get recipient address
header()  : self
Set headers
instance()  : object
Register an existing instance as a singleton.
log()  : bool
Log error
message()  : self
Set message
messageId()  : self
Generate Message-ID
multipartRelated()  : self
Set multipart related mode
recipientName()  : self
Set recipient name
sanitizeHeader()  : string
Sanitize Header Value
send()  : self
Send mail
senderName()  : self
Set sender name
separator()  : self
Set separator
subject()  : self
Set subject
to()  : self
Set recipient address
_dkimRelaxedCanonicalizeBody()  : string
The "relaxed" Body Canonicalization Algorithm
_dkimRelaxedCanonicalizeHeader()  : array<string|int, mixed>
Get the array of the "relaxed" header canonicalization
_dkimSimpleCanonicalizeBody()  : string
The "simple" Body Canonicalization Algorithm
_getChunkedMessage()  : mixed
_getDkimSignature()  : string
Get DKIM-Signature header or empty string
_getDomain()  : mixed
Get domain from $this->_from address, e.g. 'google.com' for 'my@google.com'
_getDriverName()  : string
Get full driver name
_getResponseStatus()  : string
Get status of response
_getServerName()  : string
Get Server Name
_headersToString()  : string
Convert $this->_headers to string with $this->_separator as separator
_send()  : self
Send mail
_serverFgets()  : mixed
fgets 256 bytes
_serverFputs()  : int|false
Server fputs
_serverParse()  : string
Parse server answer

Properties

$_bound

Boundary

protected string $_bound = \NULL

$_chunklen

The chunk length.

protected string $_chunklen = \NULL

$_config

List of parameters

protected array<string|int, mixed> $_config = array()

$_contentType

Mail Content-Type

protected string $_contentType = 'text/plain'

$_files

List of attached files

protected array<string|int, mixed> $_files = array()

$_fp

Stream

protected mixed $_fp = \NULL

$_from

Mail FROM field

protected string $_from = \NULL

$_headers

List of headers

protected array<string|int, mixed> $_headers = array()

$_log

protected mixed $_log = \NULL

$_message

Message text

protected string $_message = \NULL

$_multipartRelated

Multipart related mode

protected bool $_multipartRelated = \FALSE

$_recipientName

Recipient name

protected string $_recipientName = \NULL

$_senderName

Sender name

protected string $_senderName = \NULL

$_separator

Separator

protected string $_separator = \NULL

$_status

Status

protected string $_status = \FALSE

$_subject

Subject

protected string $_subject = \NULL

$_to

Mail TO field

protected string $_to = \NULL

Methods

__construct()

Constructor.

public __construct() : mixed

attach()

Attach file

public attach(string $attach) : mixed
Parameters
$attach : string

file path

$oCore_Mail->attach(array( 'filepath' => CMS_FOLDER . 'file.jpg', 'filename' => 'file.jpg', 'Content-ID' => '123456', // attachment or inline 'Content-Disposition' => 'attachment', 'Content-Type' => 'application/octet-stream' ));

bound()

Set boundary

public bound(string $bound) : self
Parameters
$bound : string

boundary value

Return values
self

chunklen()

Set chunk length

public chunklen(int $chunklen) : self
Parameters
$chunklen : int

The chunk length

Return values
self

clear()

Clear object

public clear() : self
Return values
self

config()

Set parameters

public config(array<string|int, mixed> $array) : self
Parameters
$array : array<string|int, mixed>

parameters

Return values
self

contentType()

Set content type

public contentType(string $contentType) : self
Parameters
$contentType : string

type

Return values
self

from()

Set sender address

public from(string $from) : self
Parameters
$from : string

from value

Return values
self

getFrom()

Get sender address

public getFrom() : string
Return values
string

getLog()

Get log

public getLog() : null|string
Return values
null|string

getMessage()

Get message

public getMessage() : string
Return values
string

getSeparator()

Get separator

public getSeparator() : string
Return values
string

getServerHostname()

Get server hostname

public getServerHostname() : string
Return values
string

getStatus()

Get status

public getStatus() : bool
Return values
bool

getSubject()

Get subject

public getSubject() : string
Return values
string

getTo()

Get recipient address

public getTo() : string
Return values
string

header()

Set headers

public header(string $name, string $value) : self
Parameters
$name : string

name

$value : string

value

Return values
self

instance()

Register an existing instance as a singleton.

public static instance([string $name = 'default' ][, array<string|int, mixed> $aPersonalConfig = array() ]) : object
Parameters
$name : string = 'default'
$aPersonalConfig : array<string|int, mixed> = array()
Return values
object

log()

Log error

public log() : bool
Return values
bool

message()

Set message

public message(string $message) : self
Parameters
$message : string

message text

Return values
self

messageId()

Generate Message-ID

public messageId([ $uniqueid = NULL ]) : self
Parameters
$uniqueid : = NULL
Return values
self

multipartRelated()

Set multipart related mode

public multipartRelated(bool $multipartRelated) : self
Parameters
$multipartRelated : bool

mode

Return values
self

recipientName()

Set recipient name

public recipientName(string $recipientName) : self
Parameters
$recipientName : string

name

Return values
self

sanitizeHeader()

Sanitize Header Value

public static sanitizeHeader(string $value) : string
Parameters
$value : string
Tags
see
Core_Http::sanitizeHeader()
Return values
string

send()

Send mail

public send() : self
Tags
hostcms-event

Core_Mail.onBeforeSend

hostcms-event

Core_Mail.onAfterPrepareSend

Return values
self

senderName()

Set sender name

public senderName(string $senderName) : self
Parameters
$senderName : string

name

Return values
self

separator()

Set separator

public separator(string $separator) : self
Parameters
$separator : string

separator

Return values
self

subject()

Set subject

public subject(string $subject) : self
Parameters
$subject : string

subject text

Return values
self

to()

Set recipient address

public to(string $to) : self
Parameters
$to : string

address

Return values
self

_dkimRelaxedCanonicalizeBody()

The "relaxed" Body Canonicalization Algorithm

protected _dkimRelaxedCanonicalizeBody(string $body) : string
Parameters
$body : string
Return values
string

_dkimRelaxedCanonicalizeHeader()

Get the array of the "relaxed" header canonicalization

protected _dkimRelaxedCanonicalizeHeader( $sHeaders) : array<string|int, mixed>
Parameters
$sHeaders :

Headers

Return values
array<string|int, mixed>

_dkimSimpleCanonicalizeBody()

The "simple" Body Canonicalization Algorithm

protected _dkimSimpleCanonicalizeBody(string $body) : string
Parameters
$body : string
Return values
string

_getChunkedMessage()

protected _getChunkedMessage() : mixed

_getDkimSignature()

Get DKIM-Signature header or empty string

protected _getDkimSignature(string $dkimRelaxedCanonicalizeHeader, mixed $body) : string
Parameters
$dkimRelaxedCanonicalizeHeader : string
$body : mixed
Return values
string

_getDomain()

Get domain from $this->_from address, e.g. 'google.com' for 'my@google.com'

protected _getDomain() : mixed

_getDriverName()

Get full driver name

protected static _getDriverName(string $driver) : string
Parameters
$driver : string

driver name

Return values
string

_getResponseStatus()

Get status of response

protected _getResponseStatus(string $server_response) : string
Parameters
$server_response : string
Return values
string

_getServerName()

Get Server Name

protected _getServerName() : string
Return values
string

_headersToString()

Convert $this->_headers to string with $this->_separator as separator

protected _headersToString() : string
Return values
string

_send()

Send mail

protected _send(string $to, string $subject, string $message) : self
Parameters
$to : string

recipient

$subject : string

subject

$message : string

message

Return values
self

_serverFgets()

fgets 256 bytes

protected _serverFgets() : mixed

_serverFputs()

Server fputs

protected _serverFputs(string $str) : int|false
Parameters
$str : string
Return values
int|false

_serverParse()

Parse server answer

protected _serverParse(string $server_response, string $response) : string
Parameters
$server_response : string
$response : string

response

Return values
string

        
On this page

Search results