Class Zend_Mail_Transport_Smtp

Description

Implements interfaces:

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

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


	
			
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 sendMail (Zend_Mail $mail, string $body, string $headers)
 void vrfy (string $user)
 void _expect (int $val1, [int $val2 = null], [int $val3 = null])
 string _receive ()
 void _send (string $str)
Variables
array $lastResponse = array() (line 57)

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

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

Stream to SMTP Server

  • access: protected
mixed $_host (line 48)
  • access: protected
mixed $_myName (line 50)
  • access: protected
mixed $_port (line 49)
  • access: protected
Methods
Constructor __construct (line 73)

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 88)

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 185)

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 261)

close an existing connection.

sends QUIT and closes stream.

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

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 155)

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 220)

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 248)

Sends the QUIT command and validates answer

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

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 206)

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 ()
sendMail (line 358)

send an email

  • access: public
void sendMail (Zend_Mail $mail, string $body, string $headers)
  • Zend_Mail $mail
  • string $body
  • string $headers
vrfy (line 236)

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 280)

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 317)

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

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

Send the given string followed by a LINEEND to the server

  • access: protected
  • throws: Zend_Mail_Transport_Exception
void _send (string $str)
  • string $str
Class Constants
COMMUNICATION_TIMEOUT = 2 (line 44)
CONNECTION_TIMEOUT = 30 (line 43)
DEBUG = false (line 46)
LINEEND = "\r\n" (line 45)

Documentation generated on Wed, 08 Mar 2006 04:54:52 -0800 by phpDocumentor 1.3.0RC4