Jet\Mailing_Email

The class represents an email, i.e. a specific message to send. The class can be used on its own, but is primarily intended to be used throughout the emailing subsystem in conjunction with templates.

Overview of methods

Method Meaning of
public setSenderName(
string $sender_name
) : void
Sets the sender's name.
public getSenderName(
) : string
Returns the set sender name.
public setSenderEmail(
string $sender_email
) : void
Sets the sender's email.
public getSenderEmail(
) : string
Returns the sender's configured email.
public setTo(
array|string $to
) : void
Sets a recipient, or multiple recipients.
public getTo(
) : array|string
Returns the set recipients.
public setToCopy(
array|string $to_copy
) : void
Sets a recipient in a copy, or multiple recipients in a copy.
public getToCopy(
) : array|string
Returns the set recipients in a copy.
public setToHiddenCopy(
array|string $to_hidden_copy
) : void
Sets a recipient in the hidden copy, or multiple recipients in the hidden copy.
public getToHiddenCopy(
) : array|string
Returns the set recipients in a hidden copy.
public setSubject(
string $subject
) : void
Sets the subject of the email
public getSubject(
) : string
Returns the set email subject
public setBodyTxt(
string $body_txt
) : void
Sets the textual content (plain text) of the message.
public getBodyTxt(
) : string
Returns the set text content (plain text) of the message.
public setBodyHtml(
string $body_html,
bool $parse_images=true
) : void
Sets the HTML content of the message. If the parameter $parse_images is true, then it finds references to images in the HTML and prepares to insert them directly into the message.

public getBodyHtml(
) : string
Returns the set HTML content of the message.
public addAttachments(
string $file_path,
string $file_name=''
) : void
Attaches the file as an email attachment.

Parameters:
  • $file_path
    The full path to the file to become an attachment
  • $file_name
    File name - attachments. Optional parameter - if not specified, the original file name is automatically used.
public addAttachmentsData(
string $file_name,
string $file_mime_type,
string $file_data
) : void
Attaches a data-defined mail attachment.

Parameters:
  • $file_name
    File name
  • $file_mime_type
    File MIME type
  • $file_data
    File data přílohy
public getAttachments(
) : Mailing_Email_File[]
Returns a list of attachments.
public addImage(
string $cid,
string $path
) : void
Adds an image that will be included in the email.
Parameters:
  • $cid
    Wildcard ID of the image as represented in HTML (src="cid:xxxxxxx").
  • $path
    Full path to the image file.
public addImageData(
string $cid,
string $file_name,
string $file_mime_type,
string $file_data
) : void
Adds an image that will be included in the email.
Parameters:
  • $cid
    Wildcard ID of the image as represented in HTML (src="cid:xxxxxxx").
  • $file_name
    File name
  • $file_mime_type
    File MIME type
  • $file_data
    File data
public getImages(
) : Mailing_Email_File[]
Returns a list of message images.
public setCustomHeader(
string $header,
string $value
) : void
Sets an optional SMTP message header.
Parameters:
  • $header
    Header Name.
  • $value
    Header value.
public getCustomHeaders(
) : array
Returns the configured optional SMTP message headers in the form of an associated field, where the key is the header name and the value is its value.
public prepareMessage(
?string &$message,
?string &$header
) : void
Compiles the actual email to send. That is, it assembles its body and prepares the necessary SMTP headers. Both values (message body and header) are returned as references.
public send(
) : bool
It sends the email. Actually it is call: Mailing::sendEmail$this );
Previous chapter
Jet\Mailing
Next chapter
Jet\Mailing_Email_Template