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

Class: Net_SMTP

Source Location: /pear/Net/SMTP.php

Class Overview


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


Author(s):

Variables

Methods



Class Details

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



Tags:

author:  Chuck Hagenbuch <chuck@horde.org>
author:  Jon Parise <jon@php.net>
author:  Damian Alejandro Fernandez Sosa <damlists@cnba.uba.ar>
example:  example not found


[ Top ]


Class Variables

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

[line 65]

List of supported authentication methods, in preferential order.



Tags:

access:  public

Type:   array


[ Top ]

$host =  'localhost'

[line 44]

The server to connect to.



Tags:

access:  public

Type:   string


[ Top ]

$localhost =  'localhost'

[line 58]

The value to give when sending EHLO or HELO.



Tags:

access:  public

Type:   string


[ Top ]

$port =  25

[line 51]

The port to connect to.



Tags:

access:  public

Type:   int


[ Top ]



Class Methods


constructor Net_SMTP [line 120]

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();




Tags:

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 ]

method auth [line 424]

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

Attempt to do SMTP authentication.



Tags:

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 ]

method connect [line 302]

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

Attempt to connect to the SMTP server.



Tags:

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 ]

method data [line 777]

mixed data( string $data)

Send the DATA command.



Tags:

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 ]

method disconnect [line 329]

mixed disconnect( )

Attempt to disconnect from the SMTP server.



Tags:

return:  Returns a PEAR_Error with an error message on any kind of failure, or true on success.
since:  1.0
access:  public


[ Top ]

method getResponse [line 284]

array getResponse( )

Return a 2-tuple containing the last response from the SMTP server.



Tags:

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 ]

method helo [line 653]

mixed helo( string $domain)

Send the HELO command.



Tags:

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 ]

method identifySender [line 1000]

boolean identifySender( )

Backwards-compatibility method. identifySender()'s functionality is now handled internally.



Tags:

return:  This method always return true.
since:  1.0
access:  public


[ Top ]

method mailFrom [line 684]

mixed mailFrom( string $sender, [string $params = null])

Send the MAIL FROM: command.



Tags:

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.
string   $params  

String containing additional MAIL parameters, such as the NOTIFY flags defined by RFC 1891 or the VERP protocol.

If $params is an array, only the 'verp' option is supported. If 'verp' is true, the XVERP parameter is appended to the MAIL command. If the 'verp' value is a string, the full XVERP=value parameter is appended.


[ Top ]

method noop [line 979]

mixed noop( )

Send the NOOP command.



Tags:

return:  Returns a PEAR_Error with an error message on any kind of failure, or true on success.
since:  1.0
access:  public


[ Top ]

method quotedata [line 755]

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.




Tags:

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 ]

method rcptTo [line 725]

mixed rcptTo( string $recipient, [string $params = null])

Send the RCPT TO: command.



Tags:

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.
string   $params   String containing additional RCPT parameters, such as the NOTIFY flags defined by RFC 1891.

[ Top ]

method rset [line 936]

mixed rset( )

Send the RSET command.



Tags:

return:  Returns a PEAR_Error with an error message on any kind of failure, or true on success.
since:  1.0
access:  public


[ Top ]

method samlFrom [line 899]

mixed samlFrom( string $path)

Send the SAML FROM: command.



Tags:

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 ]

method saml_from [line 923]

mixed saml_from( string $path)

Backwards-compatibility wrapper for samlFrom().



Tags:

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 ]

method sendFrom [line 821]

mixed sendFrom( string $path)

Send the SEND FROM: command.



Tags:

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 ]

method send_from [line 845]

mixed send_from( string $path)

Backwards-compatibility wrapper for sendFrom().



Tags:

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 ]

method setDebug [line 148]

void setDebug( boolean $debug)

Set the value of the debugging flag.



Tags:

since:  1.1.0
access:  public


Parameters:

boolean   $debug   New value for the debugging flag.

[ Top ]

method somlFrom [line 860]

mixed somlFrom( string $path)

Send the SOML FROM: command.



Tags:

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 ]

method soml_from [line 884]

mixed soml_from( string $path)

Backwards-compatibility wrapper for somlFrom().



Tags:

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 ]

method vrfy [line 958]

mixed vrfy( string $string)

Send the VRFY command.



Tags:

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 Sun, 08 Jan 2012 17:52:03 +0100 by phpDocumentor 1.4.3