Ö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 = '' | |
Definiert in Zeile 27 der Datei class.smtp.php.
authenticate | ( | $username, | |
$password, | |||
$authtype = 'LOGIN' , |
|||
$realm = '' , |
|||
$workstation = '' |
|||
) |
Perform SMTP authentication. Must be run after hello().
string | $username | The user name |
string | $password | The password |
string | $authtype | The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5) |
string | $realm | The auth realm for NTLM |
string | $workstation | The auth workstation for NTLM public |
Definiert in Zeile 343 der Datei class.smtp.php.
Benutzt edebug(), hmac() und sendCommand().
client_send | ( | $data) |
Send raw data to the server.
string | $data | The data to send public |
Definiert in Zeile 816 der Datei class.smtp.php.
Benutzt edebug().
Wird benutzt von data() und sendCommand().
close | ( | ) |
Close the socket and clean up the state of the class. Don't use this function without first trying to use QUIT.
Definiert in Zeile 514 der Datei class.smtp.php.
Benutzt edebug().
Wird benutzt von connected() und quit().
connect | ( | $host, | |
$port = null , |
|||
$timeout = 30 , |
|||
$options = array() |
|||
) |
Connect to an SMTP server.
string | $host | SMTP server IP or host name |
integer | $port | The port number to connect to |
integer | $timeout | How long to wait for the connection to open |
array | $options | An array of options for stream_context_create() public |
Definiert in Zeile 229 der Datei class.smtp.php.
Benutzt connected(), edebug() und get_lines().
connected | ( | ) |
Check connection state. public
Definiert in Zeile 489 der Datei class.smtp.php.
Wird benutzt von connect() und sendCommand().
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>
string | $msg_data | Message data to send public |
Definiert in Zeile 538 der Datei class.smtp.php.
Benutzt client_send() und sendCommand().
|
protected |
Output debugging info via a user-selected method.
string | $str | Debug string to output |
integer | $level | The debug level of this message; see DEBUG_* constants |
Definiert in Zeile 185 der Datei class.smtp.php.
Wird benutzt von authenticate(), client_send(), close(), connect(), connected(), get_lines(), sendCommand() und turn().
|
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
Definiert in Zeile 851 der Datei class.smtp.php.
Benutzt $Timelimit und edebug().
Wird benutzt von connect() und sendCommand().
getDebugLevel | ( | ) |
Get debug output level.
Definiert in Zeile 944 der Datei class.smtp.php.
Benutzt $do_debug.
getDebugOutput | ( | ) |
Get debug output method.
Definiert in Zeile 926 der Datei class.smtp.php.
Benutzt $Debugoutput.
getError | ( | ) |
Get the latest error. public
Definiert in Zeile 827 der Datei class.smtp.php.
Benutzt $error.
getLastReply | ( | ) |
Get the last reply from the server. public
Definiert in Zeile 837 der Datei class.smtp.php.
Benutzt $last_reply.
getTimeout | ( | ) |
Get SMTP timeout.
Definiert in Zeile 962 der Datei class.smtp.php.
Benutzt $Timeout.
getVerp | ( | ) |
Get VERP address generation mode.
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.
string | $host | The host name or IP to connect to public |
Definiert in Zeile 620 der Datei class.smtp.php.
Benutzt sendHello().
|
protected |
Calculate an MD5 HMAC hash. Works like hash_hmac('md5', $data, $key) in case that function is not available
string | $data | The data to hash |
string | $key | The key to hash with protected |
Definiert in Zeile 457 der Datei class.smtp.php.
Wird benutzt von authenticate().
( | $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>
string | $from | Source address of this message public |
Definiert in Zeile 653 der Datei class.smtp.php.
Benutzt sendCommand().
noop | ( | ) |
Send an SMTP NOOP command. Used to keep keep-alives alive, doesn't actually do anything public
Definiert in Zeile 787 der Datei class.smtp.php.
Benutzt sendCommand().
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>
boolean | $close_on_error | Should the connection close if an error occurs? public |
Definiert in Zeile 671 der Datei class.smtp.php.
Benutzt $error, close() und sendCommand().
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>
string | $toaddr | The address the message is being sent to public |
Definiert in Zeile 691 der Datei class.smtp.php.
Benutzt sendCommand().
reset | ( | ) |
Send an SMTP RSET command. Abort any transaction that is currently in progress. Implements rfc 821: RSET <CRLF> public
Definiert in Zeile 707 der Datei class.smtp.php.
Benutzt sendCommand().
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>
string | $from | The address the message is from public |
Definiert in Zeile 765 der Datei class.smtp.php.
Benutzt sendCommand().
|
protected |
Send a command to an SMTP server and check its return code.
string | $command | The command name - not sent to the server |
string | $commandstring | The actual command to send |
integer | array | $expect | One or more expected integer success codes protected |
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().
|
protected |
Send an SMTP HELO or EHLO command. Low-level implementation used by hello()
string | $hello | The HELO string |
string | $host | The hostname to say we are protected |
Definiert in Zeile 635 der Datei class.smtp.php.
Benutzt $last_reply und sendCommand().
Wird benutzt von hello().
setDebugLevel | ( | $level = 0 ) |
setDebugOutput | ( | $method = 'echo' ) |
Set debug output method.
string | $method | The function/method to use for debugging output. |
Definiert in Zeile 917 der Datei class.smtp.php.
setTimeout | ( | $timeout = 0 ) |
setVerp | ( | $enabled = false ) |
Enable or disable VERP address generation.
boolean | $enabled |
Definiert in Zeile 899 der Datei class.smtp.php.
startTLS | ( | ) |
Initiate a TLS (encrypted) session. public
Definiert in Zeile 315 der Datei class.smtp.php.
Benutzt sendCommand().
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
Definiert in Zeile 801 der Datei class.smtp.php.
Benutzt edebug().
verify | ( | $name) |
Send an SMTP VRFY command.
string | $name | The name to verify public |
Definiert in Zeile 776 der Datei class.smtp.php.
Benutzt sendCommand().
$CRLF = "\r\n" |
SMTP reply line ending. string
CRLF
constant instead 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 CLIhtml
Output escaped, line breaks converted to <br>
, appropriate for browser outputerror_log
Output to error log as configured in php.iniAlternatively, 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:
0
) No debug output, default1
) Client commands2
) Client commands and server responses3
) As DEBUG_SERVER plus connection status4
) 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().
|
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().
|
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.
|
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().
|
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
DEFAULT_SMTP_PORT
constant instead 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
VERSION
constant instead 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.