Mail
[ class tree: Mail ] [ index: Mail ] [ all elements ]

Class: Mail_smtp

Source Location: /Mail-1.2.0/Mail/smtp.php

Class Overview

Mail
   |
   --Mail_smtp

SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.


Author(s):

Version:

  • $Revision: 294747 $

Variables

Methods


Inherited Variables

Class: Mail

Mail::$sep

Inherited Methods

Class: Mail

Mail::factory()
Provides an interface for generating Mail:: objects of various types
Mail::send()
Implements Mail::send() function using php's built-in mail() command.

Class Details

[line 74]
SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.
  • Version: $Revision: 294747 $
  • Access: public


[ Top ]


Class Variables

$auth =  false

[line 114]

Should SMTP authentication be used?

This value may be set to true, false or the name of a specific authentication method.

If the value is set to true, the Net_SMTP package will attempt to use the best authentication method advertised by the remote SMTP server.


Type:   mixed


[ Top ]

$debug =  false

[line 148]

Turn on Net_SMTP debugging?

Type:   boolean


[ Top ]

$host =  'localhost'

[line 95]

The SMTP host to connect to.

Type:   string


[ Top ]

$localhost =  'localhost'

[line 134]

Hostname or domain that will be sent to the remote SMTP server in the HELO / EHLO message.

Type:   string


[ Top ]

$password =  ''

[line 126]

The password to use if the SMTP server requires authentication.

Type:   string


[ Top ]

$persist =  false

[line 156]

Indicates whether or not the SMTP connection should persist over multiple calls to the send() method.

Type:   boolean


[ Top ]

$pipelining =

[line 164]

Use SMTP command pipelining (specified in RFC 2920) if the SMTP server supports it. This speeds up delivery over high-latency connections. By default, use the default value supplied by Net_SMTP.

Type:   bool


[ Top ]

$port =  25

[line 101]

The port the SMTP server is on.

Type:   integer


[ Top ]

$timeout =  null

[line 141]

SMTP connection timeout value. NULL indicates no timeout.

Type:   integer


[ Top ]

$username =  ''

[line 120]

The username to use if the SMTP server requires authentication.

Type:   string


[ Top ]



Method Detail

Mail_smtp (Constructor)   [line 191]

Mail_smtp Mail_smtp( array $params)

Constructor.

Instantiates a new Mail_smtp:: object based on the parameters passed in. It looks for the following parameters: host The server to connect to. Defaults to localhost. port The port to connect to. Defaults to 25. auth SMTP authentication. Defaults to none. username The username to use for SMTP auth. No default. password The password to use for SMTP auth. No default. localhost The local hostname / domain. Defaults to localhost. timeout The SMTP connection timeout. Defaults to none. verp Whether to use VERP or not. Defaults to false. DEPRECATED as of 1.2.0 (use setMailParams()). debug Activate SMTP debug mode? Defaults to false. persist Should the SMTP connection persist? pipelining Use SMTP command pipelining

If a parameter is present in the $params array, it replaces the default.

  • Access: public

Parameters:

array   $params     Hash containing any parameters different from the defaults.

[ Top ]

_Mail_smtp (Destructor)   [line 216]

void _Mail_smtp( )

Destructor implementation to ensure that we disconnect from any potentially-alive persistent SMTP connections.

[ Top ]

addServiceExtensionParameter   [line 398]

void addServiceExtensionParameter( string $keyword, [string $value = null])

Add parameter associated with a SMTP service extension.
  • Since: 1.2.0
  • Access: public

Parameters:

string   $keyword     Extension keyword.
string   $value     Any value the keyword needs.

[ Top ]

disconnect   [line 411]

boolean disconnect( )

Disconnect and destroy the current SMTP connection.
  • Return: True if the SMTP connection no longer exists.
  • Since: 1.1.9
  • Access: public

[ Top ]

getSMTPObject   [line 342]

mixed &getSMTPObject( )

Connect to the SMTP server by instantiating a Net_SMTP object.
  • Return: Returns a reference to the Net_SMTP object on success, or a PEAR_Error containing a descriptive error message on failure.
  • Since: 1.2.0
  • Access: public

[ Top ]

send   [line 245]

mixed send( mixed $recipients, array $headers, string $body)

Implements Mail::send() function using SMTP.
  • Return: Returns true on success, or a PEAR_Error containing a descriptive error message on failure.
  • Access: public

Overrides Mail::send() (Implements Mail::send() function using php's built-in mail() command.)

Parameters:

mixed   $recipients     Either a comma-seperated list of recipients (RFC822 compliant), or an array of recipients, each RFC822 valid. This may contain recipients not specified in the headers, for Bcc:, resending messages, etc.
array   $headers     The array of headers to send with the mail, in an associative array, where the array key is the header name (e.g., 'Subject'), and the array value is the header value (e.g., 'test'). The header produced from those values would be 'Subject: test'.
string   $body     The full text of the message body, including any MIME parts, etc.

[ Top ]


Documentation generated on Mon, 01 Mar 2010 13:00:04 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.