Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Email

Class Email

Package: blesta\components\email
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Located at components/email/email.php

Methods summary

public
# __construct( string $charset = "UTF-8", integer $max_line_length = 1000 )

Constructs a new Email components, sets the default charset.

Constructs a new Email components, sets the default charset.

Parameters

$charset
string
$charset The default character set encoding.
$max_line_length
integer
$max_line_length The maximum line length (historically 78 chars, no more than 1000 per RFC 2822)
public
# setTransport( Swift_Transport $transport )

Sets the transport object to be used for all subsequent requests

Sets the transport object to be used for all subsequent requests

Parameters

$transport
Swift_Transport
The transport object used to send the message (SMTP, Sendmail, Mail, etc.)
public
# setFloodResistance( integer $max_messages, integer $pause_time = 0 )

Set the flood resistenance for sending messages

Set the flood resistenance for sending messages

Parameters

$max_messages
integer
$max_messages The maximum number of messages to send before disconnecting/reconnecting to the mail server
$pause_time
integer
$pause_time The number of seconds to pause before reconnecting
private
# newMessage( )

Creates a new instance of the message

Creates a new instance of the message

public
# setLogOptions( array $options )

Sets the log options to be recorded when the message is attempted

Sets the log options to be recorded when the message is attempted

Parameters

$options
array
$options An array of options to log when this message is attempted to be sent including: - company_id The ID of the company the message is being sent by - to_client_id The ID of the client the message is being sent to (optional) - from_staff_id The ID of the staff member the message is sent by (optional)
public
# setTags( array $tags )

Sets the given array of tags for replacement.

Sets the given array of tags for replacement.

Parameters

$tags
array
$tags The tags to set for replacement.

See

Email::replaceTags()
public
# setSubject( string $subject, array $replacements = array() )

Sets the subject of the message, replacing the given tags with their key/value pairs.

Sets the subject of the message, replacing the given tags with their key/value pairs.

Parameters

$subject
string
$subject The subject of the message
$replacements
array
$replacements The key/value pairs of tag replacements

See

Email::setTags()
public
# setBody( string $body, boolean $is_html = false, array $replacements = array() )

Sets the body of the message, replacing the given tags with their key/value pairs.

Sets the body of the message, replacing the given tags with their key/value pairs.

Parameters

$body
string
$body The body of the message
$is_html
boolean
$is_html True if $body is HTML, false otherwise
$replacements
array
$replacements The key/value pairs of tag replacements

See

Email::setTags()
public
# setAltBody( string $body, array $replacements = array() )

Sets the alternate body of the message, replacing the given tags with their key/value pairs.

Sets the alternate body of the message, replacing the given tags with their key/value pairs.

Parameters

$body
string
$body The body of the message
$replacements
array
$replacements The key/value pairs of tag replacements

See

Email::setTags()
public
# setFrom( string $from, string $from_name = null )

Invokes parent::SetFrom()

Invokes parent::SetFrom()

Parameters

$from
string
$from The from address
$from_name
string
$from_name The from name for this from address
public
# addAddress( string $address, string $name = null )

Invokes parent::AddAddress()

Invokes parent::AddAddress()

Parameters

$address
string
$address The email address to add as a TO address
$name
string
$name The TO name
public
# addCc( string $address, string $name = null )

Invokes parent::AddCC()

Invokes parent::AddCC()

Parameters

$address
string
$address The email address to add as a CC address
$name
string
$name The CC name
public
# addBcc( string $address, string $name = '' )

Invokes parent::AddBCC()

Invokes parent::AddBCC()

Parameters

$address
string
$address The email address to add as a BCC address
$name
string
$name The BCC name
public
# addAttachment( string $path, string $name, string $encoding, string $type )

Adds the attachment

Adds the attachment

Parameters

$path
string
$path The path to the file
$name
string
$name The name of the file
$encoding
string
$encoding The encoding of the file
$type
string
$type The MIME type of the file
public
# send( )

Invokes parent::Send() and logs the result

Invokes parent::Send() and logs the result

protected
# log( mixed $vars )

Log the last sent message to the Logs

Log the last sent message to the Logs

public
# resetAll( )

Resets all recipients, replytos, attachments, and custom headers, body and subject, and replacement tags (if any).

Resets all recipients, replytos, attachments, and custom headers, body and subject, and replacement tags (if any).

private string
# replaceTags( string $str, array $replacements )

Replaces tags in the given $str with the supplied key/value replacements, if a tag exists in Email::$tags, but is not found in $replacements, it will be replaced with null.

Replaces tags in the given $str with the supplied key/value replacements, if a tag exists in Email::$tags, but is not found in $replacements, it will be replaced with null.

Parameters

$str
string
$str The string to run replacements on.
$replacements
array
$replacements The key/value replacements.

Returns

string
The string with all replacements done.

Magic methods summary

Properties summary

public string $tag_start
#

The left tag enclosure

The left tag enclosure

public string $tag_end
#

The right tag enclosure

The right tag enclosure

public Logs $Logs
#

The logs Model, used to record outgoing messages

The logs Model, used to record outgoing messages

private array $tags
#

All tags set for replacement

All tags set for replacement

private Swift_Message $message
#

The message object for this instance

The message object for this instance

private Swift_Mailer $mailer
#

The mailer used to send the message

The mailer used to send the message

private array $options
#

An array of options to log when this message is attempted to be sent

An array of options to log when this message is attempted to be sent

private string $charset
#

The default character set encoding.

The default character set encoding.

private integer $max_line_length
#

int $max_line_length The maximum line length (historically 78 chars, no more than 1000 per RFC 2822)

int $max_line_length The maximum line length (historically 78 chars, no more than 1000 per RFC 2822)

Blesta API documentation generated by ApiGen 2.8.0