SMTP Klassenreferenz

Öffentliche Methoden

 connect ($host, $port=null, $timeout=30, $options=array())
 
 startTLS ()
 
 authenticate ($username, $password, $authtype= 'LOGIN', $realm= '', $workstation= '')
 
 connected ()
 
 close ()
 
 data ($msg_data)
 
 hello ($host= '')
 
 mail ($from)
 
 quit ($close_on_error=true)
 
 recipient ($toaddr)
 
 reset ()
 
 sendAndMail ($from)
 
 verify ($name)
 
 noop ()
 
 turn ()
 
 client_send ($data)
 
 getError ()
 
 getLastReply ()
 
 setVerp ($enabled=false)
 
 getVerp ()
 
 setDebugOutput ($method= 'echo')
 
 getDebugOutput ()
 
 setDebugLevel ($level=0)
 
 getDebugLevel ()
 
 setTimeout ($timeout=0)
 
 getTimeout ()
 

Datenfelder

const VERSION = '5.2.9'
 
const CRLF = "\r\n"
 
const DEFAULT_SMTP_PORT = 25
 
const MAX_LINE_LENGTH = 998
 
const DEBUG_OFF = 0
 
const DEBUG_CLIENT = 1
 
const DEBUG_SERVER = 2
 
const DEBUG_CONNECTION = 3
 
const DEBUG_LOWLEVEL = 4
 
 $Version = '5.2.9'
 
 $SMTP_PORT = 25
 
 $CRLF = "\r\n"
 
 $do_debug = self::DEBUG_OFF
 
 $Debugoutput = 'echo'
 
 $do_verp = false
 
 $Timeout = 300
 
 $Timelimit = 30
 

Geschützte Methoden

 edebug ($str, $level=0)
 
 hmac ($data, $key)
 
 sendHello ($hello, $host)
 
 sendCommand ($command, $commandstring, $expect)
 
 get_lines ()
 

Geschützte Attribute

 $smtp_conn
 
 $error = array()
 
 $helo_rply = null
 
 $last_reply = ''
 

Ausführliche Beschreibung

Definiert in Zeile 27 der Datei class.smtp.php.

Dokumentation der Elementfunktionen

authenticate (   $username,
  $password,
  $authtype = 'LOGIN',
  $realm = '',
  $workstation = '' 
)

Perform SMTP authentication. Must be run after hello().

Siehe auch
hello()
Parameter
string$usernameThe user name
string$passwordThe password
string$authtypeThe auth type (PLAIN, LOGIN, NTLM, CRAM-MD5)
string$realmThe auth realm for NTLM
string$workstationThe auth workstation for NTLM public
Rückgabe
boolean True if successfully authenticated.

Definiert in Zeile 343 der Datei class.smtp.php.

Benutzt edebug(), hmac() und sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

client_send (   $data)

Send raw data to the server.

Parameter
string$dataThe data to send public
Rückgabe
integer|boolean The number of bytes sent to the server or false on error

Definiert in Zeile 816 der Datei class.smtp.php.

Benutzt edebug().

Wird benutzt von data() und sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

close ( )

Close the socket and clean up the state of the class. Don't use this function without first trying to use QUIT.

Siehe auch
quit() public
Rückgabe
void

Definiert in Zeile 514 der Datei class.smtp.php.

Benutzt edebug().

Wird benutzt von connected() und quit().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

connect (   $host,
  $port = null,
  $timeout = 30,
  $options = array() 
)

Connect to an SMTP server.

Parameter
string$hostSMTP server IP or host name
integer$portThe port number to connect to
integer$timeoutHow long to wait for the connection to open
array$optionsAn array of options for stream_context_create() public
Rückgabe
boolean

Definiert in Zeile 229 der Datei class.smtp.php.

Benutzt connected(), edebug() und get_lines().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

connected ( )

Check connection state. public

Rückgabe
boolean True if connected.

Definiert in Zeile 489 der Datei class.smtp.php.

Benutzt close() und edebug().

Wird benutzt von connect() und sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

data (   $msg_data)

Send an SMTP DATA command. Issues a data command and sends the msg_data to the server, finializing the mail transaction. $msg_data is the message that is to be send with the headers. Each header needs to be on a single line followed by a <CRLF> with the message headers and the message body being separated by and additional <CRLF>. Implements rfc 821: DATA <CRLF>

Parameter
string$msg_dataMessage data to send public
Rückgabe
boolean

Definiert in Zeile 538 der Datei class.smtp.php.

Benutzt client_send() und sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

edebug (   $str,
  $level = 0 
)
protected

Output debugging info via a user-selected method.

Siehe auch
SMTP::$Debugoutput
SMTP::$do_debug
Parameter
string$strDebug string to output
integer$levelThe debug level of this message; see DEBUG_* constants
Rückgabe
void

Definiert in Zeile 185 der Datei class.smtp.php.

Wird benutzt von authenticate(), client_send(), close(), connect(), connected(), get_lines(), sendCommand() und turn().

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

get_lines ( )
protected

Read the SMTP server's response. Either before eof or socket timeout occurs on the operation. With SMTP we can tell if we have more lines to read if the 4th character is '-' symbol. If it is a space then we don't need to read anything else. protected

Rückgabe
string

Definiert in Zeile 851 der Datei class.smtp.php.

Benutzt $Timelimit und edebug().

Wird benutzt von connect() und sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

getDebugLevel ( )

Get debug output level.

Rückgabe
integer

Definiert in Zeile 944 der Datei class.smtp.php.

Benutzt $do_debug.

getDebugOutput ( )

Get debug output method.

Rückgabe
string

Definiert in Zeile 926 der Datei class.smtp.php.

Benutzt $Debugoutput.

getError ( )

Get the latest error. public

Rückgabe
array

Definiert in Zeile 827 der Datei class.smtp.php.

Benutzt $error.

getLastReply ( )

Get the last reply from the server. public

Rückgabe
string

Definiert in Zeile 837 der Datei class.smtp.php.

Benutzt $last_reply.

getTimeout ( )

Get SMTP timeout.

Rückgabe
integer

Definiert in Zeile 962 der Datei class.smtp.php.

Benutzt $Timeout.

getVerp ( )

Get VERP address generation mode.

Rückgabe
boolean

Definiert in Zeile 908 der Datei class.smtp.php.

Benutzt $do_verp.

hello (   $host = '')

Send an SMTP HELO or EHLO command. Used to identify the sending server to the receiving server. This makes sure that client and server are in a known state. Implements RFC 821: HELO <SP> <domain> <CRLF> and RFC 2821 EHLO.

Parameter
string$hostThe host name or IP to connect to public
Rückgabe
boolean

Definiert in Zeile 620 der Datei class.smtp.php.

Benutzt sendHello().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

hmac (   $data,
  $key 
)
protected

Calculate an MD5 HMAC hash. Works like hash_hmac('md5', $data, $key) in case that function is not available

Parameter
string$dataThe data to hash
string$keyThe key to hash with protected
Rückgabe
string

Definiert in Zeile 457 der Datei class.smtp.php.

Wird benutzt von authenticate().

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

mail (   $from)

Send an SMTP MAIL command. Starts a mail transaction from the email address specified in $from. Returns true if successful or false otherwise. If True the mail transaction is started and then one or more recipient commands may be called followed by a data command. Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>

Parameter
string$fromSource address of this message public
Rückgabe
boolean

Definiert in Zeile 653 der Datei class.smtp.php.

Benutzt sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

noop ( )

Send an SMTP NOOP command. Used to keep keep-alives alive, doesn't actually do anything public

Rückgabe
boolean

Definiert in Zeile 787 der Datei class.smtp.php.

Benutzt sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

quit (   $close_on_error = true)

Send an SMTP QUIT command. Closes the socket if there is no error or the $close_on_error argument is true. Implements from rfc 821: QUIT <CRLF>

Parameter
boolean$close_on_errorShould the connection close if an error occurs? public
Rückgabe
boolean

Definiert in Zeile 671 der Datei class.smtp.php.

Benutzt $error, close() und sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

recipient (   $toaddr)

Send an SMTP RCPT command. Sets the TO argument to $toaddr. Returns true if the recipient was accepted false if it was rejected. Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>

Parameter
string$toaddrThe address the message is being sent to public
Rückgabe
boolean

Definiert in Zeile 691 der Datei class.smtp.php.

Benutzt sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

reset ( )

Send an SMTP RSET command. Abort any transaction that is currently in progress. Implements rfc 821: RSET <CRLF> public

Rückgabe
boolean True on success.

Definiert in Zeile 707 der Datei class.smtp.php.

Benutzt sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

sendAndMail (   $from)

Send an SMTP SAML command. Starts a mail transaction from the email address specified in $from. Returns true if successful or false otherwise. If True the mail transaction is started and then one or more recipient commands may be called followed by a data command. This command will send the message to the users terminal if they are logged in and send them an email. Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>

Parameter
string$fromThe address the message is from public
Rückgabe
boolean

Definiert in Zeile 765 der Datei class.smtp.php.

Benutzt sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

sendCommand (   $command,
  $commandstring,
  $expect 
)
protected

Send a command to an SMTP server and check its return code.

Parameter
string$commandThe command name - not sent to the server
string$commandstringThe actual command to send
integer | array$expectOne or more expected integer success codes protected
Rückgabe
boolean True on success.

Definiert in Zeile 720 der Datei class.smtp.php.

Benutzt client_send(), connected(), edebug() und get_lines().

Wird benutzt von authenticate(), data(), mail(), noop(), quit(), recipient(), reset(), sendAndMail(), sendHello(), startTLS() und verify().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

sendHello (   $hello,
  $host 
)
protected

Send an SMTP HELO or EHLO command. Low-level implementation used by hello()

Siehe auch
hello()
Parameter
string$helloThe HELO string
string$hostThe hostname to say we are protected
Rückgabe
boolean

Definiert in Zeile 635 der Datei class.smtp.php.

Benutzt $last_reply und sendCommand().

Wird benutzt von hello().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

setDebugLevel (   $level = 0)

Set debug output level.

Parameter
integer$level

Definiert in Zeile 935 der Datei class.smtp.php.

setDebugOutput (   $method = 'echo')

Set debug output method.

Parameter
string$methodThe function/method to use for debugging output.

Definiert in Zeile 917 der Datei class.smtp.php.

setTimeout (   $timeout = 0)

Set SMTP timeout.

Parameter
integer$timeout

Definiert in Zeile 953 der Datei class.smtp.php.

setVerp (   $enabled = false)

Enable or disable VERP address generation.

Parameter
boolean$enabled

Definiert in Zeile 899 der Datei class.smtp.php.

startTLS ( )

Initiate a TLS (encrypted) session. public

Rückgabe
boolean

Definiert in Zeile 315 der Datei class.smtp.php.

Benutzt sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

turn ( )

Send an SMTP TURN command. This is an optional command for SMTP that this class does not support. This method is here to make the RFC821 Definition complete for this class and may be implemented in future Implements from rfc 821: TURN <CRLF> public

Rückgabe
boolean

Definiert in Zeile 801 der Datei class.smtp.php.

Benutzt edebug().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

verify (   $name)

Send an SMTP VRFY command.

Parameter
string$nameThe name to verify public
Rückgabe
boolean

Definiert in Zeile 776 der Datei class.smtp.php.

Benutzt sendCommand().

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Dokumentation der Datenelemente

$CRLF = "\r\n"

SMTP reply line ending. string

Veraltet:
Use the CRLF constant instead
Siehe auch
SMTP::CRLF

Definiert in Zeile 100 der Datei class.smtp.php.

$Debugoutput = 'echo'

How to handle debug output. Options:

  • echo Output plain-text as-is, appropriate for CLI
  • html Output escaped, line breaks converted to <br>, appropriate for browser output
  • error_log Output to error log as configured in php.ini

Alternatively, you can provide a callable expecting two params: a message string and the debug level: $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; string|callable

Definiert in Zeile 127 der Datei class.smtp.php.

Wird benutzt von getDebugOutput().

$do_debug = self::DEBUG_OFF

Debug output level. Options:

  • self::DEBUG_OFF (0) No debug output, default
  • self::DEBUG_CLIENT (1) Client commands
  • self::DEBUG_SERVER (2) Client commands and server responses
  • self::DEBUG_CONNECTION (3) As DEBUG_SERVER plus connection status
  • self::DEBUG_LOWLEVEL (4) Low-level data output, all messages integer

Definiert in Zeile 112 der Datei class.smtp.php.

Wird benutzt von getDebugLevel().

$do_verp = false

Whether to use VERP. http://www.postfix.org/VERP_README.html Info on VERP boolean

Definiert in Zeile 135 der Datei class.smtp.php.

Wird benutzt von getVerp().

$error = array()
protected

Error message, if any, for the last call. array

Definiert in Zeile 162 der Datei class.smtp.php.

Wird benutzt von getError() und quit().

$helo_rply = null
protected

The reply the server sent to us for HELO. If null, no HELO string has yet been received. string|null

Definiert in Zeile 169 der Datei class.smtp.php.

$last_reply = ''
protected

The most recent reply received from the server. string

Definiert in Zeile 175 der Datei class.smtp.php.

Wird benutzt von getLastReply() und sendHello().

$smtp_conn
protected

The socket for the server connection. resource

Definiert in Zeile 156 der Datei class.smtp.php.

$SMTP_PORT = 25

SMTP server port number. integer

Veraltet:
This is only ever used as a default value, so use the DEFAULT_SMTP_PORT constant instead
Siehe auch
SMTP::DEFAULT_SMTP_PORT

Definiert in Zeile 92 der Datei class.smtp.php.

$Timelimit = 30

The SMTP timelimit value for reads, in seconds. integer

Definiert in Zeile 150 der Datei class.smtp.php.

Wird benutzt von get_lines().

$Timeout = 300

The timeout value for connection, in seconds. Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. integer

Definiert in Zeile 144 der Datei class.smtp.php.

Wird benutzt von getTimeout().

$Version = '5.2.9'

The PHPMailer SMTP Version number. string

Veraltet:
Use the VERSION constant instead
Siehe auch
SMTP::VERSION

Definiert in Zeile 84 der Datei class.smtp.php.

const CRLF = "\r\n"

SMTP line break constant. string

Definiert in Zeile 39 der Datei class.smtp.php.

const DEBUG_CLIENT = 1

Debug level to show client -> server messages

Definiert in Zeile 61 der Datei class.smtp.php.

const DEBUG_CONNECTION = 3

Debug level to show connection status, client -> server and server -> client messages

Definiert in Zeile 71 der Datei class.smtp.php.

const DEBUG_LOWLEVEL = 4

Debug level to show all messages

Definiert in Zeile 76 der Datei class.smtp.php.

const DEBUG_OFF = 0

Debug level for no output

Definiert in Zeile 56 der Datei class.smtp.php.

const DEBUG_SERVER = 2

Debug level to show client -> server and server -> client messages

Definiert in Zeile 66 der Datei class.smtp.php.

const DEFAULT_SMTP_PORT = 25

The SMTP port to use if one is not specified. integer

Definiert in Zeile 45 der Datei class.smtp.php.

const MAX_LINE_LENGTH = 998

The maximum line length allowed by RFC 2822 section 2.1.1 integer

Definiert in Zeile 51 der Datei class.smtp.php.

const VERSION = '5.2.9'

The PHPMailer SMTP version number. string

Definiert in Zeile 33 der Datei class.smtp.php.


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:




Korrekturen, Hinweise und Ergänzungen

Bitte scheuen Sie sich nicht und melden Sie, was auf dieser Seite sachlich falsch oder irreführend ist, was ergänzt werden sollte, was fehlt usw. Dazu bitte oben aus dem Menü Seite den Eintrag Support Forum wählen. Es ist eine kostenlose Anmeldung erforderlich, um Anmerkungen zu posten. Unpassende Postings, Spam usw. werden kommentarlos entfernt.