Class Zend_Mail_Transport_Smtp

Description

SMTP connection object minimum implementation according to RFC2821: EHLO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, QUIT

  • license: New BSD License
  • copyright: Copyright (c) 2006 Zend Technologies USA Inc. (http://www.zend.com)

Located in /Zend/Mail/Transport/Smtp.php (line 45)

Zend_Mail_Transport_Abstract
   |
   --Zend_Mail_Transport_Smtp
Class Constant Summary
Variable Summary
 Stream $_con
 mixed $_host
 mixed $_myName
 mixed $_port
Method Summary
 Zend_Mail_Transport_Smtp __construct (string $host, [int $port = 25], [string $myName = '127.0.0.1'])
 void connect ()
 void data (string $data)
 void disconnect ()
 void helo (string $myname)
 void mail_from (string $from_email)
 void noop ()
 void quit ()
 void rcpt_to (string $to)
 void rset ()
 void vrfy (string $user)
 void _expect (int $val1, [int $val2 = null], [int $val3 = null])
 string _receive ()
 void _send (string $str)
 void _sendMail (array $to)
Variables
array $lastResponse = array() (line 60)

Last Response from the SMTP server, 1 Array Element per line

  • var: of strings
  • access: public
Stream $_con = null (line 67)

Stream to SMTP Server

  • access: protected
mixed $_host (line 51)
  • access: protected
mixed $_myName (line 53)
  • access: protected
mixed $_port (line 52)
  • access: protected

Inherited Variables

Inherited from Zend_Mail_Transport_Abstract

Zend_Mail_Transport_Abstract::$body
Zend_Mail_Transport_Abstract::$boundary
Zend_Mail_Transport_Abstract::$EOL
Zend_Mail_Transport_Abstract::$header
Zend_Mail_Transport_Abstract::$recipients
Zend_Mail_Transport_Abstract::$_headers
Zend_Mail_Transport_Abstract::$_isMultipart
Zend_Mail_Transport_Abstract::$_mail
Zend_Mail_Transport_Abstract::$_parts
Methods
Constructor __construct (line 76)

Constructor.

  • access: public
Zend_Mail_Transport_Smtp __construct (string $host, [int $port = 25], [string $myName = '127.0.0.1'])
  • string $host
  • int $port
  • string $myName: (for use with HELO)
connect (line 91)

Connect to the server with the parameters given in the constructor and send "HELO". The connection is immediately closed if an error occurs.

  • access: public
  • throws: Zend_Mail_Transport_Exception
void connect ()
data (line 186)

sends the DATA command followed by the email content (headers plus body) folowed by a dot and validates the response of the server.

  • access: public
  • throws: Zend_Mail_Transport_Exception
void data (string $data)
  • string $data
disconnect (line 265)

close an existing connection.

sends QUIT and closes stream.

  • access: public
  • throws: Zend_Mail_Transport_Exception
void disconnect ()
helo (line 137)

Sends EHLO along with the given machine name and validates server response. If EHLO fails, HELO is sent for compatibility with older MTAs.

  • access: public
  • throws: Zend_Mail_Transport_Exception
void helo (string $myname)
  • string $myname
mail_from (line 158)

sends a MAIL command for the senders address and validates the response.

  • access: public
  • throws: Zend_Mail_Transport_Exception
void mail_from (string $from_email)
  • string $from_email
noop (line 224)

Sends the NOOP command end validates answer Not used by Zend_Mail, could be used to keep a connection alive or check if it is still open.

  • access: public
  • throws: Zend_Mail_Transport_Exception
void noop ()
quit (line 252)

Sends the QUIT command and validates answer

  • access: public
  • throws: Zend_Mail_Transport_Exception
void quit ()
rcpt_to (line 171)

sends a RCPT command for a recipient address and validates the response.

  • access: public
  • throws: Zend_Mail_Transport_Exception
void rcpt_to (string $to)
  • string $to
rset (line 210)

Sends the RSET command end validates answer Not used by Zend_Mail, can be used to restore a clean smtp communication state when a transaction has been cancelled.

  • access: public
  • throws: Zend_Mail_Transport_Exception
void rset ()
vrfy (line 240)

Sends the VRFY command end validates answer The calling method needs to evaluate $this->lastResponse This function was implemented for completeness only.

It is not used by Zend_Mail.

  • access: public
  • throws: Zend_Mail_Transport_Exception
void vrfy (string $user)
  • string $user: User Name or eMail to verify
_expect (line 284)

Read the response from the stream and

check for expected return code. throws a Zend_Mail_Transport_Exception if an unexpected code is returned

  • access: protected
  • throws: Zend_Mail_Transport_Exception
void _expect (int $val1, [int $val2 = null], [int $val3 = null])
  • int $val1
  • int $val2
  • int $val3
_receive (line 321)

Get a line from the stream. includes error checking and debugging

  • access: protected
  • throws: Zend_Mail_Transport_Exception
string _receive ()
_send (line 343)

Send the given string followed by a LINEEND to the server

  • access: protected
  • throws: Zend_Mail_Transport_Exception
void _send (string $str)
  • string $str
_sendMail (line 360)

Send an email

  • access: public
void _sendMail (array $to)
  • array $to

Redefinition of:
Zend_Mail_Transport_Abstract::_sendMail()
Send an email independent from the used transport

Inherited Methods

Inherited From Zend_Mail_Transport_Abstract

 Zend_Mail_Transport_Abstract::send()
 Zend_Mail_Transport_Abstract::_buildBody()
 Zend_Mail_Transport_Abstract::_formatHeader()
 Zend_Mail_Transport_Abstract::_getHeaders()
 Zend_Mail_Transport_Abstract::_prepareHeaders()
 Zend_Mail_Transport_Abstract::_sendMail()
Class Constants
COMMUNICATION_TIMEOUT = 2 (line 48)
CONNECTION_TIMEOUT = 30 (line 47)
DEBUG = false (line 49)

Documentation generated on Fri, 30 Jun 2006 11:21:37 -0500 by phpDocumentor 1.3.0RC6