mail

Drupal 8 : Programmatically sent Mail from system - Example

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.