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

Class: Mail_smtp

Source Location: /Mail-1.3.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$

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::parseRecipients()
Take a set of recipients and parse them, returning an array of bare addresses (forward paths) that can be passed to sendmail or an smtp server with the rcpt to: command.
Mail::prepareHeaders()
Take an array of mail headers and return a string containing text usable in sending a message.
Mail::send()
Implements Mail::send() function using php's built-in mail() command.
Mail::_sanitizeHeaders()
Sanitize an array of mail headers by removing any additional header strings present in a legitimate header's value. The goal of this filter is to prevent mail injection attacks.

Class Details

[line 74]
SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.
  • Version: $Revision$
  • 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 ]

$socket_options = array()

[line 166]


Type:   mixed


[ 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

__construct (Constructor)   [line 192]

Mail_smtp __construct( 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 ]

__destruct (Destructor)   [line 215]

void __destruct( )

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

[ Top ]

addServiceExtensionParameter   [line 397]

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 409]

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 339]

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 243]

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 ]

_error   [line 430]

string _error( string $text, object $error)

Build a standardized string describing the current SMTP error.
  • Return: A string describing the current SMTP error.
  • Since: 1.1.7
  • Access: protected

Parameters:

string   $text   —  Custom string describing the error context.
object   $error   —  Reference to the current PEAR_Error object.

[ Top ]


Documentation generated on Sun, 31 Jan 2016 22:00:02 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.