# final class \SmartMailerUtils
{ } ::

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

- Language: PHP
- Located at: lib/core/plugins/lib_mail_utils.php
- Package: Application:Plugins:Mailer
- Namespace: \
- Class Name: SmartMailerUtils
- Version: v.20240118
- Depends: classes: Smart, SmartUtils, SmartFileSysUtils, SmartFileSystem, SmartMailerSend
- Usage: static object: Class::method() - This class provides only STATIC methods

## 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 (Validate) eMail Address ; Can use SMTP or just validate format
[PUBLIC]
public static function send_email ( string $logsend_dir, STRING/ARRAY $to, STRING/ARRAY $cc, string $bcc, string $subj, string $message, bool $is_html, array $attachments = [], string $replytoaddr = "", string $inreplyto = "", int $priority = 3, string $charset = "UTF-8" ) {} :: INT
@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, bool $is_html, array $attachments = [], string $replytoaddr = "", string $inreplyto = "", int $priority = 3, string $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: 2024-12-16 16:53:45 +0000

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