API Documentation

Mail/Transport/Smtp.php

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-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Mail  
subpackage
Transport  
version
$Id: Smtp.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Mail_Transport_Smtp

SMTP connection object

Loads an instance of Zend_Mail_Protocol_Smtp and forwards smtp transactions

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

Properties

Propertypublicstring  $EOL= '\n'

EOL character string used by transport

Default value\nDetails
Type
string
access
public  
Propertyprotectedstring  $_auth= ''

Authentication type OPTIONAL

Details
Type
string
Propertyprotectedarray  $_config= ''

Config options for authentication

Details
Type
array
Propertyprotected\Zend_Mail_Protocol_Smtp  $_connection= ''

Instance of Zend_Mail_Protocol_Smtp

Propertyprotectedstring  $_host= ''

Remote smtp hostname or i.p.

Details
Type
string
Propertyprotectedstring  $_name= 'localhost'

Local client hostname or i.p.

Default valuelocalhostDetails
Type
string
Propertyprotectedinteger|null  $_port= ''

Port number

Details
Type
integernull

Methods

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

Constructor.

Parameters
Name Type Description
$host string

OPTIONAL (Default: 127.0.0.1)

$config array|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

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
static

Prepend header name to header value

Inherited from: \Zend_Mail_Transport_Abstract::_formatHeader()
Parameters
Name Type Description
$item string
$key string
$prefix string
Details
access
protected  
static
 
methodprotected_getHeaders( string $boundary ) : array

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 {@link $_mail Zend_Mail object} present.

Parameters
Name Type Description
$boundary string
Returns
Type Description
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
Name Type Description
$headers array
Throws
Exception Description
\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
Type Description
\Zend_Mail_Protocolnull
methodpublicsend( \Zend_Mail $mail ) : void

Send a mail using this transport

Inherited from: \Zend_Mail_Transport_Abstract::send()
Parameters
Name Type Description
$mail \Zend_Mail
Throws
Exception Description
\Zend_Mail_Transport_Exception if mail is empty
Details
access
public  
methodpublicsetConnection(  $connection ) : void

Sets the connection protocol instance

Parameters
Name Type Description
$connection
Documentation was generated by DocBlox 0.13.3.