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

Class: Net_SMTP

Source Location: /Net_SMTP-1.2.7/SMTP.php

Class Overview


Provides an implementation of the SMTP protocol using PEAR's Net_Socket:: class.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 37]
Provides an implementation of the SMTP protocol using PEAR's Net_Socket:: class.


[ Top ]


Class Variables

$auth_methods = array('DIGEST-MD5', 'CRAM-MD5', 'LOGIN', 'PLAIN')

[line 66]

List of supported authentication methods, in preferential order.
  • Access: public

Type:   array


[ Top ]

$host =  'localhost'

[line 45]

The server to connect to.
  • Access: public

Type:   string


[ Top ]

$localhost =  'localhost'

[line 59]

The value to give when sending EHLO or HELO.
  • Access: public

Type:   string


[ Top ]

$port =  25

[line 52]

The port to connect to.
  • Access: public

Type:   int


[ Top ]



Method Detail

Net_SMTP (Constructor)   [line 121]

Net_SMTP Net_SMTP( [string $host = null], [integer $port = null], [string $localhost = null])

Instantiates a new Net_SMTP object, overriding any defaults with parameters that are passed in.

If you have SSL support in PHP, you can connect to a server over SSL using an 'ssl://' prefix:

// 465 is a common smtps port. $smtp = new Net_SMTP('ssl://mail.host.com', 465); $smtp->connect();

  • Since: 1.0
  • Access: public

Parameters:

string   $host   —  The server to connect to.
integer   $port   —  The port to connect to.
string   $localhost   —  The value to give when sending EHLO or HELO.

[ Top ]

auth   [line 425]

mixed auth( string $uid, string $pwd, [string $method = ''])

Attempt to do SMTP authentication.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.0
  • Access: public

Parameters:

string   $uid   —  The userid to authenticate as.
string   $pwd   —  The password to authenticate with.
string   $method   —  The requested authentication method. If none is specified, the best supported method will be used.

[ Top ]

connect   [line 303]

mixed connect( [int $timeout = null], [bool $persistent = false])

Attempt to connect to the SMTP server.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.0
  • Access: public

Parameters:

int   $timeout   —  The timeout value (in seconds) for the socket connection.
bool   $persistent   —  Should a persistent socket connection be used?

[ Top ]

data   [line 763]

mixed data( string $data)

Send the DATA command.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.0
  • Access: public

Parameters:

string   $data   —  The message body to send.

[ Top ]

disconnect   [line 330]

mixed disconnect( )

Attempt to disconnect from the SMTP server.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.0
  • Access: public

[ Top ]

getResponse   [line 285]

array getResponse( )

Return a 2-tuple containing the last response from the SMTP server.
  • Return: A two-element array: the first element contains the response code as an integer and the second element contains the response's arguments as a string.
  • Since: 1.1.0
  • Access: public

[ Top ]

helo   [line 654]

mixed helo( string $domain)

Send the HELO command.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.0
  • Access: public

Parameters:

string   $domain   —  The domain name to say we are.

[ Top ]

identifySender   [line 986]

boolean identifySender( )

Backwards-compatibility method. identifySender()'s functionality is now handled internally.
  • Return: This method always return true.
  • Since: 1.0
  • Access: public

[ Top ]

mailFrom   [line 681]

mixed mailFrom( string $sender, [array $args = array()])

Send the MAIL FROM: command.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.0
  • Access: public

Parameters:

string   $sender   —  The sender (reverse path) to set.
array   $args   —  optional arguments. Currently supported: verp boolean or string. If true or string verp is enabled. If string the characters are considered verp separators.

[ Top ]

noop   [line 965]

mixed noop( )

Send the NOOP command.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.0
  • Access: public

[ Top ]

quotedata   [line 741]

void quotedata( &$data, string $data)

Quote the data so that it meets SMTP standards.

This is provided as a separate public function to facilitate easier overloading for the cases where it is desirable to customize the quoting behavior.

  • Since: 1.2
  • Access: public

Parameters:

string   $data   —  The message text to quote. The string must be passed by reference, and the text will be modified in place.
   &$data   — 

[ Top ]

rcptTo   [line 716]

mixed rcptTo( string $recipient)

Send the RCPT TO: command.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.0
  • Access: public

Parameters:

string   $recipient   —  The recipient (forward path) to add.

[ Top ]

rset   [line 922]

mixed rset( )

Send the RSET command.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.0
  • Access: public

[ Top ]

samlFrom   [line 885]

mixed samlFrom( string $path)

Send the SAML FROM: command.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.2.6
  • Access: public

Parameters:

string   $path   —  The reverse path to send.

[ Top ]

saml_from   [line 909]

mixed saml_from( string $path)

Backwards-compatibility wrapper for samlFrom().
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Deprecated: 1.2.6
  • Since: 1.0
  • Access: public

Parameters:

string   $path   —  The reverse path to send.

[ Top ]

sendFrom   [line 807]

mixed sendFrom( string $path)

Send the SEND FROM: command.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.2.6
  • Access: public

Parameters:

string   $path   —  The reverse path to send.

[ Top ]

send_from   [line 831]

mixed send_from( string $path)

Backwards-compatibility wrapper for sendFrom().
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Deprecated: 1.2.6
  • Since: 1.0
  • Access: public

Parameters:

string   $path   —  The reverse path to send.

[ Top ]

setDebug   [line 149]

void setDebug( boolean $debug)

Set the value of the debugging flag.
  • Since: 1.1.0
  • Access: public

Parameters:

boolean   $debug   —  New value for the debugging flag.

[ Top ]

somlFrom   [line 846]

mixed somlFrom( string $path)

Send the SOML FROM: command.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.2.6
  • Access: public

Parameters:

string   $path   —  The reverse path to send.

[ Top ]

soml_from   [line 870]

mixed soml_from( string $path)

Backwards-compatibility wrapper for somlFrom().
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Deprecated: 1.2.6
  • Since: 1.0
  • Access: public

Parameters:

string   $path   —  The reverse path to send.

[ Top ]

vrfy   [line 944]

mixed vrfy( string $string)

Send the VRFY command.
  • Return: Returns a PEAR_Error with an error message on any kind of failure, or true on success.
  • Since: 1.0
  • Access: public

Parameters:

string   $string   —  The string to verify

[ Top ]


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