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

Class: Mail2_smtp

Source Location: /Mail2-0.1.1/Mail2/smtp.php

Class Overview

Mail2
   |
   --Mail2_smtp

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


Author(s):

Version:

  • $Revision$

Variables

Methods


Inherited Variables

Inherited Methods

Class: Mail2

Mail2::factory()
Provides an interface for generating Mail:: objects of various types
Mail2::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.
Mail2::prepareHeaders()
Take an array of mail headers and return a string containing text usable in sending a message.
Mail2::send()
Implements Mail::send() function using php's built-in mail() command.
Mail2::_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 52]
SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP2 class.
  • Version: $Revision$


[ Top ]


Class Variables

$auth =  false

[line 112]

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_SMTP2 package will attempt to use the best authentication method advertised by the remote SMTP server.


Type:   mixed


[ Top ]

$debug =  false

[line 146]

Turn on Net_SMTP2 debugging?

Type:   boolean


[ Top ]

$host =  'localhost'

[line 93]

The SMTP host to connect to.

Type:   string


[ Top ]

$localhost =  'localhost'

[line 132]

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

Type:   string


[ Top ]

$password =  ''

[line 124]

The password to use if the SMTP server requires authentication.

Type:   string


[ Top ]

$persist =  false

[line 154]

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

Type:   boolean


[ Top ]

$pipelining =

[line 162]

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_SMTP2.

Type:   bool


[ Top ]

$port =  25

[line 99]

The port the SMTP server is on.

Type:   integer


[ Top ]

$socket_options = array()

[line 164]


Type:   mixed


[ Top ]

$timeout =  null

[line 139]

SMTP connection timeout value. NULL indicates no timeout.

Type:   integer


[ Top ]

$username =  ''

[line 118]

The username to use if the SMTP server requires authentication.

Type:   string


[ Top ]

$_smtp =  null

[line 80]

SMTP connection object.
  • Access: protected

Type:   object


[ Top ]



Method Detail

__construct (Constructor)   [line 190]

Mail2_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 213]

void __destruct( )

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

[ Top ]

addServiceExtensionParameter   [line 356]

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

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

mixed getSMTPObject( )

Connect to the SMTP server by instantiating a Net_SMTP2 object.
  • Return: Returns a reference to the Net_SMTP2 object on success
  • 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
  • Access: public

Overrides Mail2::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 389]

string _error( string $text, &$error, 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.
   &$error   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 16:04:25 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.