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
- The default character set encoding.
- $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
- transport object used to send the message (SMTP, Sendmail, Mail, etc.)
|
public
|
#
setFloodResistance( integer $max_messages, integer $pause_time = 0 )
Set the flood resistance for sending messages
Set the flood resistance for sending messages
Parameters
- $max_messages
The maximum number of messages to send before
disconnecting/reconnecting to the mail server
- $pause_time
- The number of seconds to pause before reconnecting
|
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
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)
- log Bool true or false, whether to log the email (optional, default true)
|
public
|
#
setTags( array $tags )
Sets the given array of tags for replacement.
Sets the given array of tags for replacement.
Parameters
- $tags
- The tags to set for replacement.
See
Email::replaceTags()
|
public
|
#
setSubject( string $subject, array $replacements = [] )
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
- The subject of the message
- $replacements
- The key/value pairs of tag replacements
See
|
public
|
#
setBody( string $body, boolean $is_html = false, array $replacements = [] )
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
- The body of the message
- $is_html
- True if $body is HTML, false otherwise
- $replacements
- The key/value pairs of tag replacements
See
|
public
|
#
setAltBody( string $body, array $replacements = [] )
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
- The body of the message
- $replacements
- The key/value pairs of tag replacements
See
|
public
|
#
setLogBody( stdClass $body, array $replacements = [] )
Sets an alternate body for logging purposes, replacing the given tags with their
key/value pairs.
Sets an alternate body for logging purposes, replacing the given tags with their
key/value pairs.
Parameters
- $body
- The masked email containing the body of the message
- $replacements
- The key/value pairs of tag replacements
See
|
public
|
#
setFrom( string $from, string $from_name = null )
Invokes parent::SetFrom()
Invokes parent::SetFrom()
Parameters
- $from
- The from address
- $from_name
- The from name for this from address
|
public
|
#
addAddress( string $address, string $name = null )
Invokes parent::AddAddress()
Invokes parent::AddAddress()
Parameters
- $address
- The email address to add as a TO address
- $name
- The TO name
|
public
|
#
addCc( string $address, string $name = null )
Invokes parent::AddCC()
Parameters
- $address
- The email address to add as a CC address
- $name
- The CC name
|
public
|
#
addBcc( string $address, string $name = '' )
Invokes parent::AddBCC()
Parameters
- $address
- The email address to add as a BCC address
- $name
- The BCC name
|
public
|
#
addReplyTo( string $address, string $name = null )
Invokes parent::setReplyTo()
Invokes parent::setReplyTo()
Parameters
- $address
- The email address to add as a ReplyTo address
- $name
- The ReplyTo name
|
public
|
#
addAttachment( string $path, string $name, string $encoding, string $type )
Adds the attachment
Parameters
- $path
- The path to the file
- $name
- The name of the file
- $encoding
- The encoding of the file
- $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( array $vars )
Log the last sent message to the Logs
Log the last sent message to the Logs
Parameters
- $vars
A key/value array of data to log, including:
- log If false, will not log the email
-
|
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).
|