Abstract Class Swift_Transport_AbstractSmtpTransport
Inheritance | Swift_Transport_AbstractSmtpTransport |
---|---|
Implements | Swift_Transport |
Subclasses | Swift_SendmailTransport, Swift_SmtpTransport, Swift_Transport_EsmtpTransport, Swift_Transport_SendmailTransport |
Sends Messages over SMTP.
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$_buffer | Input-Output buffer for sending/receiving SMTP commands and responses | Swift_Transport_AbstractSmtpTransport | |
$_domain | The domain name to use in HELO command | Swift_Transport_AbstractSmtpTransport | |
$_eventDispatcher | The event dispatching layer | Swift_Transport_AbstractSmtpTransport | |
$_sourceIp | Source Ip | Swift_Transport_AbstractSmtpTransport | |
$_started | Connection status | Swift_Transport_AbstractSmtpTransport |
Public Methods
Protected Methods
Property Details
Method Details
Creates a new EsmtpTransport using the given I/O buffer.
public void __construct ( Swift_Transport_IoBuffer $buf, Swift_Events_EventDispatcher $dispatcher ) | ||
$buf | Swift_Transport_IoBuffer | |
$dispatcher | Swift_Events_EventDispatcher |
Destructor.
public void __destruct ( ) |
Throws an Exception if a response code is incorrect
protected void _assertResponseCode ( $response, $wanted ) | ||
$response | ||
$wanted |
Send the DATA command
protected void _doDataCommand ( ) |
Send the HELO welcome
protected void _doHeloCommand ( ) |
Send the MAIL FROM command
protected void _doMailFromCommand ( $address ) | ||
$address |
Send the RCPT TO command
protected void _doRcptToCommand ( $address ) | ||
$address |
Return an array of params for the Buffer
protected abstract void _getBufferParams ( ) |
Get an entire multi-line response using its sequence number
protected void _getFullResponse ( $seq ) | ||
$seq |
Determine the best-use reverse path for this message
protected void _getReversePath ( Swift_Mime_Message $message ) | ||
$message |
Read the opening SMTP greeting
protected void _readGreeting ( ) |
Stream the contents of the message over the buffer
protected void _streamMessage ( Swift_Mime_Message $message ) | ||
$message |
Throw a TransportException, first sending it to any listeners
protected void _throwException ( Swift_TransportException $e ) | ||
$e |
Run a command against the buffer, expecting the given response codes.
If no response codes are given, the response will not be validated. If codes are given, an exception will be thrown on an invalid response.
public string executeCommand ( $command, $codes = [], <b>&</b>$failures = null ) | ||
$command | string | |
$codes | int | |
$failures | string[] | An array of failures by-reference |
Get the IoBuffer where read/writes are occurring.
public Swift_Transport_IoBuffer getBuffer ( ) |
Get the name of the domain Swift will identify as.
public string getLocalDomain ( ) |
Returns the IP used to connect to the destination.
public string getSourceIp ( ) |
Test if an SMTP connection has been established.
public bool isStarted ( ) |
Register a plugin.
public void registerPlugin ( Swift_Events_EventListener $plugin ) | ||
$plugin | Swift_Events_EventListener |
Reset the current mail transaction.
public void reset ( ) |
Send the given Message.
Recipient/sender data will be retrieved from the Message API. The return value is the number of recipients who were accepted for delivery.
public int send ( Swift_Mime_Message $message, <b>&</b>$failedRecipients = null ) | ||
$message | Swift_Mime_Message | |
$failedRecipients | string[] | An array of failures by-reference |
Set the name of the local domain which Swift will identify itself as.
This should be a fully-qualified domain name and should be truly the domain you're using.
If your server doesn't have a domain name, use the IP in square brackets (i.e. [127.0.0.1]).
public Swift_Transport_AbstractSmtpTransport setLocalDomain ( $domain ) | ||
$domain | string |
Sets the source IP.
public void setSourceIp ( $source ) | ||
$source | string |
Start the SMTP connection.
public void start ( ) |
Stop the SMTP connection.
public void stop ( ) |