Smart.Framework Logo

final class \SmartMailerUtils
{ } ::

Class: SmartMailerUtils - provides various util functions for eMail like: Check/Validate, Send.


class Methods

public static function check_email_address ( string $email, bool $checkdomain = false, string $helo = "", int $smtp_port = 25 ) {} :: ARRAY
@return: {ARRAY} ['status'] = ok / notok ; ['message'] = validation message
@param: {STRING} $email: eMail Address
@param: {BOOL} $checkdomain: FALSE = only validate if email address is in the form of text@texte.xt | TRUE = check email with MX + SMTP validation
@param: {STRING} $helo: SMTP HELO (if check MX + Domain will be used, cannot be empty)
@param: {NUMBER} $smtp_port: SMTP Port (normal is '25')
Check eMail Address
[PUBLIC]
public static function send_email ( STRING $logsend_dir, STRING/ARRAY $to, STRING/ARRAY $cc, STRING $bcc, STRING $subj, STRING $message, TRUE/FALSE $is_html, array $attachments = [], STRING $replytoaddr = "", STRING $inreplyto = "", ENUM $priority = "3", ENUM $charset = "UTF-8" ) {} :: TRUE/FALSE
@return: {TRUE/FALSE} OPERATION RESULT [1 = OK ; 0 = send error ; -1 = error, empty config ]
@param: {STRING} $logsend_dir: A Directory relative path where to store send log messages OR Empty (no store): '' | 'tmp/my-email-send-log-dir'
@param: {STRING/ARRAY} $to: To: to@addr | [ 'to1@addr', 'to2@addr', ... ]
@param: {STRING/ARRAY} $cc: Cc: '' | cc@addr | [ 'cc1@addr', 'cc2@addr', ... ]
@param: {STRING} $bcc: Bcc: '' | bcc@addr
@param: {STRING} $subj: Subject: Your Subject
@param: {STRING} $message: Message: The body of the message
@param: {TRUE/FALSE} $is_html: Format: FALSE = Text/Plain ; TRUE = HTML
@param: {ARRAY} $attachments: * Attachments array: [] | ['file1.txt'=>'This is the file 1 content', ...] :: default is []
@param: {STRING} $replytoaddr: * Reply To Addr: '' | reply-to@addr :: default is ''
@param: {STRING} $inreplyto: * In Reply To: '' | the ID of message that is replying to :: default is ''
@param: {ENUM} $priority: * Priority: 1=High ; 3=Normal ; 5=Low :: default is 3
@param: {ENUM} $charset: * charset :: default is UTF-8
Send Email Mime Message from Smart.Framework to a destination with optional log of sent messages to a specific directory
It will use the default server settings from configs: $configs['sendmail'][]
public static function send_custom_email ( ARRAY $mail_config, STRING $logsend_dir, STRING/ARRAY $to, STRING/ARRAY $cc, STRING $bcc, STRING $subj, STRING $message, TRUE/FALSE $is_html, array $attachments = [], STRING $replytoaddr = "", STRING $inreplyto = "", ENUM $priority = "3", ENUM $charset = "UTF-8" ) {} :: ARRAY
@return: {ARRAY} [ 'result' => 'Operation RESULT', 'error' => 'ERROR Message if any', 'log' => 'Send LOG', 'message' => 'The Mime MESSAGE' ]
@param: {ARRAY} $mail_config: send config array (keys that start with * are optional): [ server-mx-domain, server-host, server-port, server-ssl, *server-cafile, *auth-user, *auth-password, *auth-mode, *from-return, from-address, from-name, *use-qp-encoding, *use-min-enc-subj, *use-antispam-rules ]
@param: {STRING} $logsend_dir: A Directory relative path where to store send log messages OR Empty (no store): '' | 'tmp/my-email-send-log-dir'
@param: {STRING/ARRAY} $to: To: to@addr | [ 'to1@addr', 'to2@addr', ... ]
@param: {STRING/ARRAY} $cc: Cc: '' | cc@addr | [ 'cc1@addr', 'cc2@addr', ... ]
@param: {STRING} $bcc: Bcc: '' | bcc@addr
@param: {STRING} $subj: Subject: Your Subject
@param: {STRING} $message: Message: The body of the message
@param: {TRUE/FALSE} $is_html: Format: FALSE = Text/Plain ; TRUE = HTML
@param: {ARRAY} $attachments: * Attachments array: [] | ['file1.txt'=>'This is the file 1 content', ...] :: default is []
@param: {STRING} $replytoaddr: * Reply To Addr: '' | reply-to@addr :: default is ''
@param: {STRING} $inreplyto: * In Reply To: '' | the ID of message that is replying to :: default is ''
@param: {ENUM} $priority: * Priority: 1=High ; 3=Normal ; 5=Low :: default is 3
@param: {ENUM} $charset: * charset :: default is UTF-8
Send Email Mime Message from Smart.Framework to a destination with optional log of sent messages to a specific directory
It will use custom server settings as 1st parameter: $mail_config

class Properties


class Constants



documentation generated on: 2023-10-19 23:15:51 +0000


Smart.Framework © 2009-2023 unix-world.org