Documentation

main

Class handles all mail-relevants

Table of Contents

Properties

$emhost  : string
$emport  : string
$emssl  : string
$tmail  : tab_mail
$tmail_attachments  : tab_mail_attachments

Methods

__construct()  : mixed
__destruct()  : mixed
addtoqueue()  : bool
Adds an email to the queue for sending.
delete()  : bool
getqueue()  : array<string|int, mixed>|bool
sendall()  : bool
sendsingle()  : bool
getmailbody()  : string
Retrieves the email body from the specified mail.php file.
getmailtextbody()  : string
Retrieves the text version of the email body.
sendmail()  : bool
Sends an email using PHPMailer.

Properties

$emhost

protected string $emhost

$emport

protected string $emport

$emssl

protected string $emssl

Methods

__construct()

public __construct() : mixed

__destruct()

public __destruct() : mixed

addtoqueue()

Adds an email to the queue for sending.

public addtoqueue(string $tid, string $to, string $cc, string $bcc, string $subject, string $prehead, string $ticketheader, string $ticketsubject, string $ticketnum, string $tickettext, array<string|int, mixed> $attachments) : bool
Parameters
$tid : string
$to : string

The recipient email address.

$cc : string

The carbon copy email address(es) (optional).

$bcc : string

The blind carbon copy email address(es) (optional).

$subject : string

The subject of the email.

$prehead : string

The preheader text of the email.

$ticketheader : string

The ticket header text (optional).

$ticketsubject : string

The ticket subject text (optional).

$ticketnum : string

The ticket number (optional).

$tickettext : string

The ticket text (optional).

$attachments : array<string|int, mixed>
Return values
bool

Returns true if the email is added to the queue, false otherwise.

delete()

public delete(string $val[, string $col = 'id' ]) : bool
Parameters
$val : string
$col : string = 'id'
Return values
bool

getqueue()

public getqueue() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|bool

sendall()

public sendall() : bool
Return values
bool

sendsingle()

public sendsingle(string $id) : bool
Parameters
$id : string
Return values
bool

getmailbody()

Retrieves the email body from the specified mail.php file.

private getmailbody() : string

This method retrieves the email body from the mail.php file located in the specified theme directory. It uses the global $theme variable to determine the active theme and includes the mail.php file using the PHP include function. The output buffer is started with the ob_start function to capture the contents of the mail.php file, and then ob_get_clean is used to retrieve the buffered content and return it as a string.

Return values
string

The email body as a string.

getmailtextbody()

Retrieves the text version of the email body.

private getmailtextbody() : string
Tags
global

object $theme The current theme object.

Return values
string

The text version of the email body.

sendmail()

Sends an email using PHPMailer.

private sendmail(int $m) : bool
Parameters
$m : int

['id'] The email ID (optional).

Tags
throws
Exception

If an error occurs while sending the email.

Return values
bool

Returns true if the email is sent successfully, false otherwise.


        
On this page

Search results