[ PHPXref.com ] [ Generated: Sun Jul 20 20:30:05 2008 ] [ Swift Mailer 1.2.1 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> Swift.php (summary)

Swift Mailer: A Flexible PHP Mailer Class. Current functionality:

Author: Chris Corbyn
Copyright: Copyright © 2006 Chris Corbyn - All Rights Reserved.
License: http://www.gnu.org/licenses/lgpl.txt Lesser GNU Public License
Version: 1.2.1
File Size: 1323 lines (34 kb)
Included or required: 10 times
Referenced: 0 times
Includes or requires: 0 files

Defines 4 classes

Swift_IPlugin:: (1 method):
  loadBaseObject()

Swift_IAuthenticator:: (2 methods):
  loadBaseObject()
  run()

Swift_IConnection:: (3 methods):
  start()
  stop()
  isConnected()

Swift:: (57 methods):
  __construct()
  connect()
  isConnected()
  handshake()
  supportsESMTP()
  setPriority()
  requestReadReceipt()
  setCharset()
  useExactCopy()
  setReplyTo()
  addBcc()
  addCc()
  useAutoLineResizing()
  addExpectedCode()
  getAuthenticationMethods()
  loadPlugin()
  getPlugin()
  removePlugin()
  triggerEventHandler()
  loadDefaultAuthenticators()
  authenticate()
  loadAuthenticator()
  getMimeBoundary()
  addHeaders()
  setMimeBoundary()
  setMimeWarning()
  autoFlush()
  flush()
  flushTo()
  flushCc()
  flushBcc()
  flushParts()
  flushAttachments()
  flushHeaders()
  logError()
  logTransaction()
  getResponse()
  getResponseCode()
  getCommandKeyword()
  command()
  chunkSplitLines()
  addPart()
  addAttachment()
  addImage()
  close()
  hasFailed()
  fail()
  encode()
  quotedPrintableEncode()
  LFtoCRLF()
  makeSafe()
  getAddress()
  makeRecipientHeaders()
  parseAddressList()
  send()
  buildMail()
  getMimeBody()


Interface: Swift_IPlugin  - X-Ref

Swift Plugin Interface. Describes the methods which plugins should implement

loadBaseObject(&$object)   X-Ref
Loads an instance of Swift to the Plugin

param: object  SwiftInstance
return: void

Interface: Swift_IAuthenticator  - X-Ref

Swift Authenticator Interface. Describes the methods which authenticators should implement

loadBaseObject(&$object)   X-Ref
Loads an instance of Swift to the Plugin

param: object  SwiftInstance
return: void

run($username, $password)   X-Ref
Executes the logic in the authentication mechanism

param: string  username
param: string  password
return: bool  successful

Interface: Swift_IConnection  - X-Ref

Swift Connection Handler Interface.
Describes the methods which connection handlers should implement

start()   X-Ref
Establishes a connection with the MTA

return: bool  connected

stop()   X-Ref
Closes the connection with the MTA

return: void

isConnected()   X-Ref
Returns a boolean value TRUE if the connection is active.

return: bool connected

Class: Swift  - X-Ref

Swift Mailer Class.
Accepts connections to an MTA and deals with the sending and processing of
commands and responses.

__construct(Swift_IConnection &$object, $domain=false)   X-Ref
Swift Constructor

param: object  Swift_IConnection
param: string  user_domain, optional

connect()   X-Ref
Connect to the server

return: bool connected

isConnected()   X-Ref
Returns TRUE if the connection is active.


handshake()   X-Ref
Sends the standard polite greetings to the MTA and then
identifies the MTA's capabilities


supportsESMTP($greeting)   X-Ref
Checks for Extended SMTP support

param: string  MTA greeting
return: bool  ESMTP

setPriority($level)   X-Ref
Sets the priority level of the email
This must be 1 to 5 where 1 is highest

param: int priority

requestReadReceipt($request=true)   X-Ref
Request a read receipt from all recipients

param: bool request receipt

setCharset($string="UTF-8")   X-Ref
Set the character encoding were using

param: string charset

useExactCopy($use=true)   X-Ref
Whether or not Swift should send unique emails to all To recipients

param: bool unique

setReplyTo($string)   X-Ref
Sets the Reply-To address used for sending mail

param: string address

addBcc($addresses)   X-Ref
Add one or more Blind-carbon-copy recipients to the mail

param: mixed addresses

addCc($addresses)   X-Ref
Add one or more Carbon-copy recipients to the mail

param: mixed addresses

useAutoLineResizing($use=true)   X-Ref
Force swift to break lines longer than 76 characters long

param: bool  resize

addExpectedCode($command, $code)   X-Ref
Associate a code with a command. Swift will fail quietly if the code
returned does not match.

param: string  command
param: int  code

getAuthenticationMethods($list)   X-Ref
Reads the EHLO return string to see what AUTH methods are supported

param: string  EHLO response
return: void

loadPlugin(Swift_IPlugin &$object)   X-Ref
Load a plugin object into Swift

param: object  Swift_IPlugin
return: void

getPlugin($name)   X-Ref
Fetch a reference to a plugin in Swift

param: string  plugin name
return: object  Swift_IPlugin

removePlugin($name)   X-Ref
Un-plug a loaded plugin. Returns false on failure.

param: string plugin_name
return: bool success

triggerEventHandler($func)   X-Ref
Trigger event handlers

param: string  event handler
return: void

loadDefaultAuthenticators()   X-Ref
Attempt to load any authenticators from the Swift/ directory

return: void

authenticate($username, $password)   X-Ref
Use SMTP authentication

param: string  username
param: string  password
return: bool  successful

loadAuthenticator(Swift_IAuthenticator &$object)   X-Ref
Load an authentication mechanism object into Swift

param: object  Swift_IAuthenticator
return: void

getMimeBoundary($string=false)   X-Ref
Get a unique multipart MIME boundary

param: string  mail data, optional
return: string  boundary

addHeaders($string)   X-Ref
Append a string to the message header

param: string  headers
return: void

setMimeBoundary($string)   X-Ref
Set the multipart MIME boundary (only works for first part)

param: string  boundary
return: void

setMimeWarning($warning)   X-Ref
Set the text that displays in non-MIME clients

param: string  warning
return: void

autoFlush($flush=true)   X-Ref
Tells Swift to clear out attachment, parts, headers etc
automatically upon sending - this is the default.

param: bool flush

flush($clear_headers=false)   X-Ref
Empty out the MIME parts and attachments

param: bool  reset headers
return: void

flushTo()   X-Ref
Reset to


flushCc()   X-Ref
Reset Cc


flushBcc()   X-Ref
Reset Bcc


flushParts()   X-Ref
Reset parts


flushAttachments()   X-Ref
Reset attachments


flushHeaders()   X-Ref
Reset headers


logError($errstr, $errno=0)   X-Ref
Log an error in Swift::errors

param: string  error string
param: int  error number
return: void

logTransaction($command='')   X-Ref
Log a transaction in Swift::transactions

param: string  command
return: void

getResponse()   X-Ref
Read the data from the socket

return: string  response

getResponseCode($string)   X-Ref
Get the number of the last server response

param: string  response string
return: int  response code

getCommandKeyword($comm)   X-Ref
Get the first word of the command

param: string  command
return: string  keyword

command($comm)   X-Ref
Issue a command to the socket

param: string  command
return: string  response

chunkSplitLines($string)   X-Ref
Splits lines longer than 76 characters to multiple lines

param: string  text
return: string chunked output

addPart($string, $type='text/plain', $encoding='7bit')   X-Ref
Add a part to a multipart message

param: string  body
param: string  content-type, optional
param: string  content-transfer-encoding, optional
return: void

addAttachment($data, $filename, $type='application/octet-stream')   X-Ref
Add an attachment to a multipart message.
Attachments are added as base64 encoded data.

param: string  data
param: string  filename
param: string  content-type
return: void

addImage($path)   X-Ref
Insert an inline image and return it's name
These work like attachments but have a content-id
and are inline/related.

param: string path
return: string name

close()   X-Ref
Close the connection in the connecion object

return: void

hasFailed()   X-Ref
Check if Swift has failed and stopped processing

return: bool  failed

fail()   X-Ref
Force Swift to fail and stop processing

return: void

encode($string, $type)   X-Ref
Encode a string (mail) in a given format
Currently supports:
- BASE64
- Quoted-Printable
- Ascii 7-bit

param: string  input
param: string  encoding
return: string  encoded output

quotedPrintableEncode($string)   X-Ref
Handles quoted-printable encoding
From php.net by user bendi at interia dot pl

param: string  input
return: string  encoded output

LFtoCRLF($string)   X-Ref
Converts lone LF characters to CRLF

param: string  input
return: string  converted output

makeSafe($string)   X-Ref
Prevents premature <CRLF>.<CRLF> strings
Converts any lone LF characters to CRLF

param: string  input
return: string  escaped output

getAddress($string)   X-Ref
Pulls an email address from a "Name" <add@ress> string

param: string input
return: string address

makeRecipientHeaders($address=false)   X-Ref
Builds the headers needed to reflect who the mail is sent to
Presently this is just the "To: " header

param: string  address
return: string  headers

parseAddressList($u_array)   X-Ref
Structure a given array of addresses into the 1-dim we want

param: array unstructured
return: array structured

send($to, $from, $subject, $body=false, $type='text/plain', $encoding='7bit')   X-Ref
Send an email using Swift (send commands)

param: string  to_address
param: string  from_address
param: string  subject
param: string  body, optional
param: string  content-type,optional
param: string  content-transfer-encoding,optional
return: bool  successful

buildMail($to, $from, $subject, $body, $type='text/plain', $encoding='7bit', $return_data_part=true)   X-Ref
Builds the list of commands to send the email
The last command in the output is the email itself (DATA)
The commands are as follows:
- MAIL FROM: <address> (0)
- RCPT TO: <address> (1)
- DATA (2)
- <email> (3)

param: string  to_address
param: string  from_address
param: string  subject
param: string  body, optional
param: string  content-type, optional
param: string  encoding, optional
return: array  commands

getMimeBody($string, $type, $encoding)   X-Ref
Returns the MIME-specific headers followed by the email
content as a string.

param: string body
param: string content-type
param: string encoding
return: string mime data



[ Powered by PHPXref - Served by Debian GNU/Linux ]