/**
*
* Simple email send function.
*
* NOTE: mail() function is not suitable for larger volumes of email
* in a loop because opens and closes an SMTP socket for each email,
* which is not very efficient. Better alternatives:
* - PHPMailer: https://github.com/PHPMailer/PHPMailer
* - PEAR::Mail: http://pear.php.net/package/Mail
* - PEAR::Mail_Queue: http://pear.php.net/package/Mail_Queue
*
* For HTML formated (MIME) emails it is best to use:
* - PEAR::Mail_Mime: http://pear.php.net/package/Mail_Mime
*
*
* Parameters
* -------------------------------------------------------------------------
* to: recipient email
* from: sender email
* to_name: recipient name
* from_name: sender name
* replyto: Reply-To header email
* replyto_name: Reply-To name
* subject: email subject
* body: email message body
* envelope: sender envelope email
* charset: email codification charset (UTF-8 by default)
* mailer: email X-Mailer header (phpversion by default)
* mime: true to codify subject and body as mime (true by default)
*
* @param array $opt email parameters
* @return boolean|array true if email sent, array with messages if error
*/