public abstract class EmailGateway

class.emailgateway.php #46

A base class for email gateways. All email-gateways should extend this class in order to work.

Methods

void __construct()
boolean|mixed __get(string $name)

Gets a property.

Magic function, supplied by php. This function will attempt to find a variable set with $name and returns it. If the variable is not set, it will return false.

Parameters
  • $name stringThe property name.

void|boolean __set(string $name, string $value)

Sets a property.

Magic function, supplied by php. This function will try and find a method of this class, by camelcasing the name, and appending it with set. If the function can not be found, an exception will be thrown.

Parameters
  • $name stringThe property name.

  • $value stringThe property value;

void appendHeaderField(string $name, string $body)

Appends a single header field to the header fields array. The header field should be presented as a name/body pair.

Parameters
  • $name stringThe header field name. Examples are From, X-Sender and Reply-to.

  • $body stringThe header field body.

void appendHeaderFields(array $header_array)

Appends one or more header fields to the header fields array. Header fields should be presented as an array with name/body pairs.

Parameters
  • $header_array arrayThe header fields. Examples are From, X-Sender and Reply-to.

string contentInfoArray(mixed $type, mixed $file)

Builds the right content-type/encoding types based on file and content-type.

Will return a string containing the section, or an empty array on failure. Can be used to send to an email server directly.

XMLElement getPreferencesPane()

The preferences to add to the preferences pane in the admin area.

void send()

Sends the actual email. This function should be set on the email-gateway itself. See the default gateway for an example.

void setAttachments(string|array $file)
void setFrom(string $email, string $name)

Sets the sender-email and sender-name.

Parameters
  • $email stringThe email-address emails will be sent from.

  • $name stringThe name the emails will be sent from.

void setRecipients(string|array $email)

Sets the recipients.

Parameters
  • $email string|arrayThe email-address(es) to send the email to.

void setReplyToEmailAddress(string $email)

Sets the reply-to-email.

Parameters
  • $email stringThe email-address emails should be replied to.

void setReplyToName(string $name)

Sets the reply-to-name.

Parameters
  • $name stringThe name emails should be replied to.

void setSenderEmailAddress(string $email)

Sets the sender-email.

Parameters
  • $email stringThe email-address emails will be sent from.

void setSenderName(string $name)

Sets the sender-name.

Parameters
  • $name stringThe name emails will be sent from.

void setSubject(string $subject)

Sets the subject.

Parameters
  • $subject stringThe subject that the email will have.

void setTextEncoding(string $encoding)
Parameters
  • $encoding stringMust be either quoted-printable or base64.

void setTextHtml(string $text_html)

This functions takes a string to be used as the HTML content for the Email

void setTextPlain(string $text_plain)

This functions takes a string to be used as the plaintext content for the Email

boolean validate()

Check to see if all required data is set.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details