Mail
Sending email is now quit complecate due to the number of security you have to pass thru, it's not enough to have the perfect
mail server, but the format of you email and its headers must be correct too.
Based on PHPmailer that you can find in libs/external,
this class has the single objective to send mail properly based on the config/email.php from your instance,
please take a look at this config file to set options and signatures.
Usage :
$my_mail=new Mail();
to embed an image
$my_mail->mail->AddEmbeddedImage($path, $name);
to attach a file
$my_mail->mail->addAttachment($path, $name );
to send it :
$my_mail->send($to, $subject, $message, $from = null, $cc = false, $naming=false)
the send function is calling phpmailer, but if for any reason you have to use some simplier function
or older ones you'll find :
send0 : the smallest sending function with miminal hearders
send1 : the same as send 0 but with html utf-8 doubled content
send2 : the same as send 1 but with multipart boundary, that allow you to add attachment as multipart in the message. (the old fashion method)
(if you don't use commercial smtp and you need your own mailserver take a look on https://github.com/docker-mailserver/docker-mailserver)
@see https://github.com/PHPMailer/PHPMailer/ please support their project