Class Swift_Connection_Sendmail

Description

Swift Sendmail Connection

Located in /Swift/Connection/Sendmail.php (line 19)

Swift_ConnectionBase
   |
   --Swift_Connection_Sendmail
Class Constant Summary
Variable Summary
string $flags
string $path
array $pipes
resource $proc
string $request
boolean $send
int $timeout
Method Summary
Swift_Connection_Sendmail __construct ([string $command = "/usr/sbin/sendmail -bs"], [int $timeout = 10])
void __destruct ()
string findSendmail ()
string getCommand ()
string getFlags ()
string getPath ()
int getTimeout ()
boolean isAlive ()
void pipeIn (string $command, [ $end = "\r\n"])
string pipeOut ()
string read ()
void setCommand (string $command)
void setFlags (string $flags)
void setPath (string $path)
void setTimeout (int $secs)
void start ()
void stop ()
void write (string $command, [ $end = "\r\n"])
Variables
string $flags = null (line 29)

Flags for the MTA (options such as bs or t)

  • access: protected
string $path = null (line 34)

The full path to the MTA

  • access: protected
array $pipes (line 50)

I/O pipes for the process

  • access: protected
resource $proc (line 45)

The process handle

  • access: protected
string $request = null (line 40)

The type of last request sent

For example MAIL, RCPT, DATA

  • access: protected
boolean $send = false (line 55)

Switches to true for just one command when DATA has been issued

  • access: protected
int $timeout = 10 (line 60)

The timeout in seconds before giving up

  • var: Seconds
  • access: protected

Inherited Variables

Inherited from Swift_ConnectionBase

Swift_ConnectionBase::$extensions
Swift_ConnectionBase::$isESMTP
Methods
Constructor __construct (line 67)

Constructor

  • access: public
Swift_Connection_Sendmail __construct ([string $command = "/usr/sbin/sendmail -bs"], [int $timeout = 10])
  • string $command: The command to execute
  • int $timeout: The timeout in seconds before giving up
Destructor __destruct (line 348)

Destructor.

Cleans up by stopping any running processes.

  • access: public
void __destruct ()
findSendmail (line 126)

For auto-detection of sendmail path

Thanks to "Joe Cotroneo" for providing the enhancement

  • access: public
string findSendmail ()
getCommand (line 183)

Get the sendmail command (path + flags)

  • access: public
string getCommand ()
getFlags (line 100)

Get the operating flags for the MTA

  • access: public
string getFlags ()
getPath (line 117)

Get the path to the binary

  • access: public
string getPath ()
getTimeout (line 84)

Get the timeout on the process

  • access: public
int getTimeout ()
isAlive (line 336)

Check if the process is still alive

  • access: public
boolean isAlive ()
pipeIn (line 192)

Write a command to the open pipe

  • access: protected
  • throws: Swift_ConnectionException If the pipe cannot be written to
void pipeIn (string $command, [ $end = "\r\n"])
  • string $command: The command to write
  • $end
pipeOut (line 203)

Read data from the open pipe

  • access: protected
  • throws: Swift_ConnectionException If the pipe is not operating as expected
string pipeOut ()
read (line 229)

Read a full response from the buffer (this is spoofed if running in -t mode)

  • access: public
  • throws: Swift_ConnectionException Upon failure to read
string read ()
setCommand (line 166)

Set the sendmail command (path + flags)

  • access: public
  • throws: Swift_ConnectionException If the command is not correctly structured
void setCommand (string $command)
  • string $command: Command
setFlags (line 92)

Set the operating flags for the MTA

  • access: public
void setFlags (string $flags)
  • string $flags
setPath (line 108)

Set the path to the binary

  • access: public
void setPath (string $path)
  • string $path: The path (must be absolute!)
setTimeout (line 76)

Set the timeout on the process

  • access: public
void setTimeout (int $secs)
  • int $secs: The number of seconds
start (line 275)

Try to start the connection

  • access: public
  • throws: Swift_ConnectionException Upon failure to start
void start ()
stop (line 313)

Try to close the connection

  • access: public
void stop ()
write (line 257)

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

  • access: public
  • throws: Swift_ConnectionException 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::getRequiresEHLO()
Swift_ConnectionBase::hasExtension()
Swift_ConnectionBase::postConnect()
Swift_ConnectionBase::setExtension()
Swift_ConnectionBase::setRequiresEHLO()
Class Constants
AUTO_DETECT = -2 (line 24)

Constant for auto-detection of paths

Documentation generated on Wed, 26 Mar 2008 20:33:11 +1100 by phpDocumentor 1.3.1