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

Class: Mail_smtp

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

Class Overview

Mail
   |
   --Mail_smtp

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


Author(s):

Version:

  • $Revision: 1.28 $

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 47]
SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.
  • Version: $Revision: 1.28 $
  • Access: public


[ Top ]


Class Variables

$auth =  false

[line 80]

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

Turn on Net_SMTP debugging?

Type:   boolean


[ Top ]

$host =  'localhost'

[line 61]

The SMTP host to connect to.

Type:   string


[ Top ]

$localhost =  'localhost'

[line 100]

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

Type:   string


[ Top ]

$password =  ''

[line 92]

The password to use if the SMTP server requires authentication.

Type:   string


[ Top ]

$persist =  false

[line 130]

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

Type:   boolean


[ Top ]

$port =  25

[line 67]

The port the SMTP server is on.

Type:   integer


[ Top ]

$timeout =  null

[line 107]

SMTP connection timeout value. NULL indicates no timeout.

Type:   integer


[ Top ]

$username =  ''

[line 86]

The username to use if the SMTP server requires authentication.

Type:   string


[ Top ]

$verp =  false

[line 115]

Whether to use VERP or not. If not a boolean, the string value will be used as the VERP separators.
  • Var: boolean or string

Type:   mixed


[ Top ]



Method Detail

Mail_smtp (Constructor)   [line 155]

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. debug Activate SMTP debug mode? Defaults to false. persist Should the SMTP connection persist?

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

void _Mail_smtp( )

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

[ Top ]

disconnect   [line 313]

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 ]

send   [line 204]

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, 11 Mar 2019 14:46:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.