class Mail

Properties

$host
$port
$helo
$auth
$user
$password
$use_tls
$verify_ssl
$force_from_address
$force_from_name
array $extract_html_options

Methods

__construct($force_from_address = NULL, $force_from_name = NULL)

No description

mixed
complete_html_links_cb(mixed $matches)

Make relative links absolute to the current server

htmlMimeMail
create(string $subject, $text, bool|string $from = false, array|bool $cc = false, array|bool $bcc = false, bool $attachment = false, bool $header = false, bool $return_path = false, bool $text_encoding = false)

Creates an email and returns the mail object

array
extract_html_images(string $html_text, string $basepath, string $fnmatch_url = '*', bool $strip_missing_images = true, bool $always_return_absolute_urls = false, bool $replace_only_links = false)

Extracts all HTML Image Sources, changes their src names, downloads the files and returns an email attachment array Use to change external HTML image sources to inline attachment images

array
extract_html_images_cb(array $matches)

Extract HTML images

string
get_draft_header($mail, $to, $cc = false)

No description

array
get_errors()

No description

get_sender()

No description

array
get_smtp_log()

No description

bool
is_valid_email(string $email, bool $check_dns = false)

Checks wether the passes email has a valid format (using reg-ex)

array
mass_send(mixed $to, mixed $subject, mixed $text, mixed $from = false, mixed $cc = false, mixed $bcc = false, mixed $attachment = false, mixed $header = false, mixed $return_path = false, mixed $text_encoding = false)

Same as send(), but sends the email to each recipient individually instead of all receivers in one mail

array
prepare_attachment(string $path_to_file, bool|string $name = false)

Prepare Attachment for sending

bool
send(string $to, string $subject, string|array $text, bool|string $from = false, bool|string $cc = false, bool|string $bcc = false, array|bool $attachment = false, array|bool $header = false, bool|string $return_path = false, bool|string $text_encoding = false, bool $wrap_in_theme = false)

Send mail via SMTP (replacing old Sendmail)

bool
send_mail(htmlMimeMail $mail, array $to)

Send the mail via the proper relay and do logging

Details

at line 21
__construct($force_from_address = NULL, $force_from_name = NULL)

No description

Parameters

$force_from_address
$force_from_name

Make relative links absolute to the current server

Parameters

mixed $matches

Return Value

mixed

at line 301
htmlMimeMail create(string $subject, $text, bool|string $from = false, array|bool $cc = false, array|bool $bcc = false, bool $attachment = false, bool $header = false, bool $return_path = false, bool $text_encoding = false)

Creates an email and returns the mail object

Parameters

string $subject

subject

$text

$text is string or array, string = plain/text - array = array('html'=>'your html','text'=>'your plain message')

bool|string $from

from email

array|bool $cc

CC recipients

array|bool $bcc

BCC recipients

bool $attachment

$attachment is array: $attachment[0]['binary'],$attachment[0]['name'], $attachment[0]['type'], $attachment[0]['encoding'] = (default) base64, $attachment[0]['embedded'] for embedded images

bool $header
bool $return_path
bool $text_encoding

Return Value

htmlMimeMail

at line 402
array extract_html_images(string $html_text, string $basepath, string $fnmatch_url = '*', bool $strip_missing_images = true, bool $always_return_absolute_urls = false, bool $replace_only_links = false)

Extracts all HTML Image Sources, changes their src names, downloads the files and returns an email attachment array Use to change external HTML image sources to inline attachment images

Parameters

string $html_text

HTML Source inkl. img tags

string $basepath

Basepath of the URL for relative links

string $fnmatch_url

FNMatch wildcard pattern

bool $strip_missing_images

remove missing images

bool $always_return_absolute_urls
bool $replace_only_links

skip image replacement and complete only links, e.g. System API Mail manages images on its own

Return Value

array

mail->send() compatible attachment array -> use $return['html'] and $return['attachment'] as parameters

at line 426
array extract_html_images_cb(array $matches)

Extract HTML images

Parameters

array $matches

Return Value

array

at line 508
string get_draft_header($mail, $to, $cc = false)

No description

Parameters

$mail
$to
$cc

Return Value

string

at line 249
array get_errors()

No description

Return Value

array

at line 53
get_sender()

No description

at line 256
array get_smtp_log()

No description

Return Value

array

at line 531
bool is_valid_email(string $email, bool $check_dns = false)

Checks wether the passes email has a valid format (using reg-ex)

Parameters

string $email

Email

bool $check_dns

Set true to do a DNS check on the email hostname (reduces performance)

Return Value

bool

True/False if email is valid

at line 275
array mass_send(mixed $to, mixed $subject, mixed $text, mixed $from = false, mixed $cc = false, mixed $bcc = false, mixed $attachment = false, mixed $header = false, mixed $return_path = false, mixed $text_encoding = false)

Same as send(), but sends the email to each recipient individually instead of all receivers in one mail

Parameters

mixed $to
mixed $subject
mixed $text
mixed $from
mixed $cc
mixed $bcc
mixed $attachment
mixed $header
mixed $return_path
mixed $text_encoding

Return Value

array

Array with result for each recipient e.g. $array[test@domain.com]=true;

at line 65
array prepare_attachment(string $path_to_file, bool|string $name = false)

Prepare Attachment for sending

Parameters

string $path_to_file
bool|string $name

Optional Different Name

Return Value

array

Attachment Format

at line 92
bool send(string $to, string $subject, string|array $text, bool|string $from = false, bool|string $cc = false, bool|string $bcc = false, array|bool $attachment = false, array|bool $header = false, bool|string $return_path = false, bool|string $text_encoding = false, bool $wrap_in_theme = false)

Send mail via SMTP (replacing old Sendmail)

Parameters

string $to

or array TO Email (if string , or ; as separator)

string $subject

Subject

string|array $text

= ['html'=>'your html','text'=>'your plain message'] is string or array, string = plain/text

bool|string $from

From Email

bool|string $cc

or array CC Emails (if string , or ; as separator)

bool|string $bcc

or array BCC Emails (if string , or ; as separator)

array|bool $attachment

Attachment of format: $attachments[]['binary'],$attachments[]['name'], $attachments[]['type'], $attachments[]['encoding'] = (default) base64, $attachments[]['embedded'] for embedded images

array|bool $header

Additional Header (e.g. array('X-myHeader'=>'my data'))

bool|string $return_path

Return Path (Email)

bool|string $text_encoding

Encoding (e.g. ISO-8859-1 or UTF-8)

bool $wrap_in_theme

Wrap the Email text in the theme vars if available

Return Value

bool

success

at line 182
bool send_mail(htmlMimeMail $mail, array $to)

Send the mail via the proper relay and do logging

Parameters

htmlMimeMail $mail
array $to

recipients

Return Value

bool

success