\UbillingPHPMail
Ubilling email sending based on phpmail class
Synopsis
class UbillingPHPMail
{
- // constants
- const QUEUE_PATH = 'content/phpmailqueue/';
- // members
- protected string $mailerDebug = 'DEBUG_OFF';
- protected string $mailerSMTPHost = 'smtp.mail.server';
- protected string $mailerSMTPPort = '25';
- protected string $mailerSMTPSecure = 'ENCRYPTION_SMTPS';
- protected bool $mailerSMTPAuth = true;
- protected string $mailerSMTPUser = '';
- protected string $mailerSMTPPasswd = '';
- protected string $mailerSMTPDefaultFrom = '';
- public $phpMailer = NULL;
- public string $mailerAttachPath = 'exports/';
- // methods
- public void __construct()
- public string getQueuePath()
- public PHPMailer initPHPMailer()
- public bool sendEmail()
- public int getQueueCount()
- public array getQueueData()
- public int deleteEmail()
- public int deleteAttachment()
- public void directPushEmail()
Constants
Name | Value |
---|---|
QUEUE_PATH | 'content/phpmailqueue/' |
Members
protected
- $mailerDebug
—
string
Enable SMTP debugging SMTP::DEBUG_OFF = off (for production use) SMTP::DEBUG_CLIENT = client messages SMTP::DEBUG_SERVER = client and server messages - $mailerSMTPAuth
—
bool
SMTP authentication on/off - $mailerSMTPDefaultFrom
—
string
Will be used in email <From> field if not specified in message itself - $mailerSMTPHost
—
string
Address/hostname of the remote SMTP server that will be used to send messages - $mailerSMTPPasswd
—
string
Password used to authenticate on SMTP server - $mailerSMTPPort
—
string
SMTP port to use to connect to remote SMTP server - $mailerSMTPSecure
—
string
Encryption type to use for SMTP connection empty - encryption off, ENCRYPTION_SMTPS - ssl, ENCRYPTION_STARTTLS - tls - $mailerSMTPUser
—
string
Login used to authenticate on SMTP server
public
- $mailerAttachPath
—
string
Contains path to the attachments directory - $phpMailer
—
null
Placeholder for PHPMailer object
Methods
public
- __construct() — Creates new PHPMail queue class instance
- deleteAttachment() — Deletes attachment after sending
- deleteEmail() — Deletes message from local queue
- directPushEmail() — Directly sends email message to recepient using PHP mail function.
- getQueueCount() — Returns count of emails available in queue
- getQueueData() — Returns array containing all emails queue data as index=>data
- getQueuePath() — QUEUE_PATH getter
- initPHPMailer() — Inits and returns a PHPMailer object instance
- sendEmail() — Stores message in email sending queue. Use this method in your modules.