How to send email in Acumatica

Hi,

today want to share quick code snippet on how to send email from Acumatica. For this purpose, good usage is for NotificationGenerator. See the code below:

public virtual void SendEmailNotification(string emailstring subjectstring emailBody)
{
    var sender = new NotificationGenerator
    {
        To = email,
        Subject = subject,
        Body = emailBody,
        BodyFormat = EmailFormatListAttribute.Html
    };
    sender.Send();
}