In Drupal 8 there is function service() from core is used to send Emails. This function returns a object that help to trigger mail from system by passing argument as “plugin.manager.mail”. Using this Object call mail() function. After initiate mail need to call hook_mail() for define the Mail subject, Body and From address.
In Drupal we can't send HTML mails, It won’t support HTML content rendering. In Drupal mail Body considered as normal text. So we need to alter the mail content mime type to HTML for HTML tags support.
In Drupal 7 we can send mail using the function drupal_mail(). It help to sent mail from our Drupal system. This function need mail module, mail key, to mail id, from id, mail language and parameters with mail subject and message body.