Core_Mail_Smtp
extends Core_Mail
in package
SMTP driver
Tags
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
selfchunklen()
Set chunk length
public
chunklen(int $chunklen) : self
Parameters
- $chunklen : int
-
The chunk length
Return values
selfclear()
Clear object
public
clear() : self
Return values
selfconfig()
Set parameters
public
config(array<string|int, mixed> $array) : self
Parameters
- $array : array<string|int, mixed>
-
parameters
Return values
selfcontentType()
Set content type
public
contentType(string $contentType) : self
Parameters
- $contentType : string
-
type
Return values
selffrom()
Set sender address
public
from(string $from) : self
Parameters
- $from : string
-
from value
Return values
selfgetFrom()
Get sender address
public
getFrom() : string
Return values
stringgetLog()
Get log
public
getLog() : null|string
Return values
null|stringgetMessage()
Get message
public
getMessage() : string
Return values
stringgetSeparator()
Get separator
public
getSeparator() : string
Return values
stringgetServerHostname()
Get server hostname
public
getServerHostname() : string
Return values
stringgetStatus()
Get status
public
getStatus() : bool
Return values
boolgetSubject()
Get subject
public
getSubject() : string
Return values
stringgetTo()
Get recipient address
public
getTo() : string
Return values
stringheader()
Set headers
public
header(string $name, string $value) : self
Parameters
- $name : string
-
name
- $value : string
-
value
Return values
selfinstance()
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
objectlog()
Log error
public
log() : bool
Return values
boolmessage()
Set message
public
message(string $message) : self
Parameters
- $message : string
-
message text
Return values
selfmessageId()
Generate Message-ID
public
messageId([ $uniqueid = NULL ]) : self
Parameters
Return values
selfmultipartRelated()
Set multipart related mode
public
multipartRelated(bool $multipartRelated) : self
Parameters
- $multipartRelated : bool
-
mode
Return values
selfrecipientName()
Set recipient name
public
recipientName(string $recipientName) : self
Parameters
- $recipientName : string
-
name
Return values
selfsanitizeHeader()
Sanitize Header Value
public
static sanitizeHeader(string $value) : string
Parameters
- $value : string
Tags
Return values
stringsend()
Send mail
public
send() : self
Tags
Return values
selfsenderName()
Set sender name
public
senderName(string $senderName) : self
Parameters
- $senderName : string
-
name
Return values
selfseparator()
Set separator
public
separator(string $separator) : self
Parameters
- $separator : string
-
separator
Return values
selfsubject()
Set subject
public
subject(string $subject) : self
Parameters
- $subject : string
-
subject text
Return values
selfto()
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
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