SMTP connection object

Loads an instance of Zend_Mail_Protocol_Smtp and forwards smtp transactions

category Zend
package Zend_Mail
subpackage Transport
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
inherited_from \Zend_Mail_Transport_Abstract

 Methods

Constructor.

__construct(string $host = '127.0.0.1', array|null $config = array()) : void
todo Someone please make this compatible with the SendMail transport class.

Parameters

$host

string

OPTIONAL (Default: 127.0.0.1)

$config

arraynull

OPTIONAL (Default: null)

Class destructor to ensure all open connections are closed

__destruct() : void

Send an email via the SMTP connection protocol

_sendMail() : void

The connection via the protocol adapter is made just-in-time to allow a developer to add a custom adapter if required before mail is sent.

todo Rename this to sendMail, it's a public method...
inherited_from \Zend_Mail_Transport_Abstract::_sendMail()

Gets the connection protocol instance

getConnection() : \Zend_Mail_Protocol | null

Returns

\Zend_Mail_Protocolnull

Send a mail using this transport

send(\Zend_Mail $mail) : void
Inherited
access public

Parameters

$mail

\Zend_Mail

Exceptions

\Zend_Mail_Transport_Exception if mail is empty

Sets the connection protocol instance

setConnection(\Zend_Mail_Protocol_Abstract $connection) : void

Parameters

$connection

Generate MIME compliant message from the current configuration

_buildBody() : void
Inherited

If both a text and HTML body are present, generates a multipart/alternative Zend_Mime_Part containing the headers and contents of each. Otherwise, uses whichever of the text or HTML parts present.

The content part is then prepended to the list of Zend_Mime_Parts for this message.

Prepend header name to header value

_formatHeader(string $item, string $key, string $prefix) : void
InheritedStatic
static
access protected

Parameters

$item

string

$key

string

$prefix

string

Return all mail headers as an array

_getHeaders(string $boundary) : array
Inherited

If a boundary is given, a multipart header is generated with a Content-Type of either multipart/alternative or multipart/mixed depending on the mail parts present in the \$_mail present.

Parameters

$boundary

string

Returns

array

Format and fix headers

_prepareHeaders(array $headers) : void

Some SMTP servers do not strip BCC headers. Most clients do it themselves as do we.

access protected
inherited_from \Zend_Mail_Transport_Abstract::_prepareHeaders()

Parameters

$headers

array

Exceptions

\Zend_Transport_Exception

Prepare header string for use in transport

_prepareHeaders(mixed $headers) : void
Inherited

Prepares and generates \$header based on the headers provided.

access protected

Parameters

$headers

mixed

Exceptions

\Zend_Mail_Transport_Exception if any header lines exceed 998 characters

Send an email independent from the used transport

_sendMail() 
Inherited

The requisite information for the email will be found in the following properties:

  • \$recipients - list of recipients (string)
  • \$header - message header
  • \$body - message body

 Properties

 

EOL character string used by transport

$EOL : string

Default

"\n"
access public
inherited_from \Zend_Mail_Transport_Abstract::EOL
 

EOL character string used by transport

$EOL : string

Default

"\r\n"
access public
 

Mail body

$body : string

Default

''
access public
 

MIME boundary

$boundary : string

Default

''
access public
 

Mail header string

$header : string

Default

''
access public
 

Recipients string

$recipients : string

Default

''
access public
 

Authentication type OPTIONAL

$_auth : string

Default

 

Config options for authentication

$_config : array

Default

 

Instance of Zend_Mail_Protocol_Smtp

$_connection : \Zend_Mail_Protocol_Smtp

Default

 

Array of message headers

$_headers : array

Default

array()
access protected
 

Remote smtp hostname or i.p.

$_host : string

Default

 

Message is a multipart message

$_isMultipart : boolean

Default

false
access protected
 

Zend_Mail object

$_mail : false | \Zend_Mail

Default

false
access protected
 

Local client hostname or i.p.

$_name : string

Default

'localhost'
 

Array of message parts

$_parts : array

Default

array()
access protected
 

Port number

$_port : integer | null

Default