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

Class: Mail_smtp

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

Class Overview

Mail
   |
   --Mail_smtp

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


Author(s):

Version:

  • $Revision: 1.20 $

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


[ Top ]


Class Variables

$auth =  false

[line 52]

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

Turn on Net_SMTP debugging?

Type:   boolean


[ Top ]

$host =  'localhost'

[line 33]

The SMTP host to connect to.

Type:   string


[ Top ]

$localhost =  'localhost'

[line 72]

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

Type:   string


[ Top ]

$password =  ''

[line 64]

The password to use if the SMTP server requires authentication.

Type:   string


[ Top ]

$port =  25

[line 39]

The port the SMTP server is on.

Type:   integer


[ Top ]

$timeout =  null

[line 79]

SMTP connection timeout value. NULL indicates no timeout.

Type:   integer


[ Top ]

$username =  ''

[line 58]

The username to use if the SMTP server requires authentication.

Type:   string


[ Top ]

$verp =  false

[line 87]

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

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.

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 ]

send   [line 155]

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:18:25 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.