Class Swift_Connection_SMTP

Description

Swift SMTP Connection

Located in /Swift/Connection/SMTP.php (line 20)

Swift_ConnectionBase
   |
   --Swift_Connection_SMTP
Class Constant Summary
Method Summary
void attachAuthenticator ( $auth)
Swift_Connection_SMTP __construct ([string $server = "localhost"], [int $port = null], [int $encryption = null])
int getEncryption ()
string getPassword ()
int getPort ()
string getServer ()
int getTimeout ()
string getUsername ()
boolean isAlive ()
void postConnect ( $instance)
string read ()
void runAuthenticators (string $user, string $pass,  $swift)
void setEncryption (int $enc)
void setPassword (string $pass)
void setPort (int $port)
void setServer (string $server)
void setTimeout (int $time)
void setUsername (string $user)
void start ()
void stop ()
void write (string $command, [ $end = "\r\n"])
Methods
attachAuthenticator (line 188)

Add an authentication mechanism to authenticate with

void attachAuthenticator ( $auth)
  • Swift_Authenticator $auth
Constructor __construct (line 88)

Constructor

Swift_Connection_SMTP __construct ([string $server = "localhost"], [int $port = null], [int $encryption = null])
  • string $server: The remote server to connect to
  • int $port: The remote port to connect to
  • int $encryption: The encryption level to use
getEncryption (line 209)

Get the current encryption level used

This method returns an integer corresponding to one of the constants ENC_TLS, ENC_SSL or ENC_OFF

int getEncryption ()
getPassword (line 180)

Get the password for authentication

string getPassword ()
getPort (line 148)

Get the remote port number currently used to connect

int getPort ()
getServer (line 127)

Get the remote server name

string getServer ()
getTimeout (line 106)

Get the timeout currently set for connecting

int getTimeout ()
getUsername (line 164)

Get the username for authentication

string getUsername ()
isAlive (line 361)

Check if the SMTP connection is alive

boolean isAlive ()
postConnect (line 285)

Authenticate if required to do so

  • throws: Swift_Connection_Exception If authentication fails
void postConnect ( $instance)
  • Swift $instance: An instance of Swift

Redefinition of:
Swift_ConnectionBase::postConnect()
Execute any needed logic after connecting and handshaking
read (line 220)

Read a full response from the buffer

inner !feof() patch provided by Christian Rodriguez: <a href="http://www.flyspray.org/">www.flyspray.org</a>

  • throws: Swift_Connection_Exception Upon failure to read
string read ()
runAuthenticators (line 300)

Run each authenticator in turn an try for a successful login

If none works, throw an exception

  • throws: Swift_Connection_Exception Upon failure to authenticate
void runAuthenticators (string $user, string $pass,  $swift)
  • string $user: Username
  • string $pass: Password
  • Swift $swift: An instance of swift
setEncryption (line 199)

Set the encryption level to use on the connection

See the constants ENC_TLS, ENC_SSL and ENC_OFF NOTE: PHP needs to have been compiled with OpenSSL for SSL and TLS to work NOTE: Some PHP installations will not have the TLS stream wrapper

void setEncryption (int $enc)
  • int $enc: Level of encryption
setPassword (line 172)

Set the password for SMTP authentication

void setPassword (string $pass)
  • string $pass: Password to use
setPort (line 135)

Set the remote port number to connect to

void setPort (int $port)
  • int $port: Port number
setServer (line 114)

Set the remote server to connect to as a FQDN

void setServer (string $server)
  • string $server: Server name
setTimeout (line 98)

Set the timeout to connect in seconds

void setTimeout (int $time)
  • int $time: Timeout to use
setUsername (line 156)

Provide a username for authentication

void setUsername (string $user)
  • string $user: The username
start (line 255)

Try to start the connection

  • throws: Swift_Connection_Exception Upon failure to start
void start ()
stop (line 346)

Try to close the connection

  • throws: Swift_Connection_Exception Upon failure to close
void stop ()
write (line 246)

Write a command to the server (leave off trailing CRLF)

  • throws: swift_Connection_Exception Upon failure to write
void write (string $command, [ $end = "\r\n"])
  • string $command: The command to send
  • $end

Inherited Methods

Inherited From Swift_ConnectionBase

Swift_ConnectionBase::getAttributes()
Swift_ConnectionBase::hasExtension()
Swift_ConnectionBase::postConnect()
Swift_ConnectionBase::setExtension()
Class Constants
AUTO_DETECT = -2 (line 45)

Constant for auto-detection of paramters

ENC_OFF = 8 (line 33)

Constant for unencrypted connections

ENC_SSL = 4 (line 29)

Constant for SSL connections

ENC_TLS = 2 (line 25)

Constant for TLS connections

PORT_DEFAULT = 25 (line 37)

Constant for the default SMTP port

PORT_SECURE = 465 (line 41)

Constant for the default secure SMTP port

Documentation generated on Tue, 06 Mar 2007 23:32:28 +0000 by phpDocumentor 1.3.1