Mail/Transport/Smtp.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Mail  
Subpackage
Transport  
Version
$Id: Smtp.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Mail_Transport_Smtp

Package: Zend\Mail\Transport
SMTP connection object

Loads an instance of Zend_Mail_Protocol_Smtp and forwards smtp transactions

Parent(s)
\Zend_Mail_Transport_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertypublicstring $EOL = "\n"
EOL character string used by transport
Default value"\n"Details
Type
string
Access
public  
>VPropertyprotectedstring $_auth
Authentication type OPTIONAL
Details
Type
string
>VPropertyprotectedarray $_config
Config options for authentication
Details
Type
array
>VPropertyprotected\Zend_Mail_Protocol_Smtp $_connection
Instance of Zend_Mail_Protocol_Smtp
>VPropertyprotectedarray $_headers = array()
inherited
Array of message headers
Inherited from: \Zend_Mail_Transport_Abstract::$$_headers
Default valuearray()Details
Type
array
Access
protected  
Inherited_from
\Zend_Mail_Transport_Abstract::$$_headers  
>VPropertyprotectedstring $_host
Remote smtp hostname or i.p.
Details
Type
string
>VPropertyprotectedboolean $_isMultipart = false
inherited
Message is a multipart message
Inherited from: \Zend_Mail_Transport_Abstract::$$_isMultipart
Default valuefalseDetails
Type
boolean
Access
protected  
Inherited_from
\Zend_Mail_Transport_Abstract::$$_isMultipart  
>VPropertyprotectedfalse|\Zend_Mail $_mail = false
inherited
Zend_Mail object
Inherited from: \Zend_Mail_Transport_Abstract::$$_mail
Default valuefalseDetails
Type
false | \Zend_Mail
Access
protected  
Inherited_from
\Zend_Mail_Transport_Abstract::$$_mail  
>VPropertyprotectedstring $_name = 'localhost'
Local client hostname or i.p.
Default value'localhost'Details
Type
string
>VPropertyprotectedarray $_parts = array()
inherited
Array of message parts
Inherited from: \Zend_Mail_Transport_Abstract::$$_parts
Default valuearray()Details
Type
array
Access
protected  
Inherited_from
\Zend_Mail_Transport_Abstract::$$_parts  
>VPropertyprotectedinteger|null $_port
Port number
Details
Type
integer | null
>VPropertypublicstring $body = ''
inherited
Mail body
Inherited from: \Zend_Mail_Transport_Abstract::$$body
Default value''Details
Type
string
Access
public  
Inherited_from
\Zend_Mail_Transport_Abstract::$$body  
>VPropertypublicstring $boundary = ''
inherited
MIME boundary
Inherited from: \Zend_Mail_Transport_Abstract::$$boundary
Default value''Details
Type
string
Access
public  
Inherited_from
\Zend_Mail_Transport_Abstract::$$boundary  
>VPropertypublicstring $header = ''
inherited
Mail header string
Inherited from: \Zend_Mail_Transport_Abstract::$$header
Default value''Details
Type
string
Access
public  
Inherited_from
\Zend_Mail_Transport_Abstract::$$header  
>VPropertypublicstring $recipients = ''
inherited
Recipients string
Inherited from: \Zend_Mail_Transport_Abstract::$$recipients
Default value''Details
Type
string
Access
public  
Inherited_from
\Zend_Mail_Transport_Abstract::$$recipients  

Methods

methodpublic__construct(string $host = '127.0.0.1', array | null $config = array()) : void

Constructor.

Parameters
NameTypeDescription
$hoststring

OPTIONAL (Default: 127.0.0.1)

$configarray | null

OPTIONAL (Default: null)

Details
Todo
Someone please make this compatible with the SendMail transport class.  
methodpublic__destruct() : void

Class destructor to ensure all open connections are closed

methodprotected_buildBody() : void
inherited

Generate MIME compliant message from the current configuration

Inherited from: \Zend_Mail_Transport_Abstract::_buildBody()

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.

methodprotected_formatHeader(string $item, string $key, string $prefix) : void
staticinherited

Prepend header name to header value

Inherited from: \Zend_Mail_Transport_Abstract::_formatHeader()
Parameters
NameTypeDescription
$itemstring
$keystring
$prefixstring
Details
Access
protected  
Static
 
methodprotected_getHeaders(string $boundary) : array
inherited

Return all mail headers as an array

Inherited from: \Zend_Mail_Transport_Abstract::_getHeaders()

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 Zend_Mail object present.

Parameters
NameTypeDescription
$boundarystring
Returns
TypeDescription
array
methodprotected_prepareHeaders(array $headers) : void

Format and fix headers

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

Parameters
NameTypeDescription
$headersarray
Throws
ExceptionDescription
\Zend_Transport_Exception
Details
Access
protected  
methodpublic_sendMail() : void

Send an email via the SMTP connection protocol

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.

Details
Todo
Rename this to sendMail, it's a public method...  
methodpublicgetConnection() : \Zend_Mail_Protocol | null

Gets the connection protocol instance

Returns
TypeDescription
\Zend_Mail_Protocol | null
methodpublicsend(\Zend_Mail $mail) : void
inherited

Send a mail using this transport

Inherited from: \Zend_Mail_Transport_Abstract::send()
Parameters
NameTypeDescription
$mail\Zend_Mail
Throws
ExceptionDescription
\Zend_Mail_Transport_Exceptionif mail is empty
Details
Access
public  
methodpublicsetConnection( $connection) : void

Sets the connection protocol instance

Parameters
NameTypeDescription
$connection
Documentation was generated by phpDocumentor 2.0.0a12.