public void SendEmailFromTemplate(CBAUser user, string subject, MimeEntity content) { EmailMessage message = new EmailMessage { Sender = new MailboxAddress("CBA Admin", _emailMetadata.Sender), Reciever = new MailboxAddress($"{user.FirstName} {user.LastName}", user.Email), Subject = subject, Content = content }; var mimeMessage = EmailMessage.CreateEmailMessage(message); SmtpClient smtpClient = new SmtpClient(); smtpClient.Connect(_emailMetadata.SmtpServer, _emailMetadata.Port, true); smtpClient.Authenticate(_emailMetadata.UserName, _emailMetadata.Password); smtpClient.Send(mimeMessage); smtpClient.Disconnect(true); }