Q: Send an email with a HTML file as body. Parameters such as name, email address etc need to be injected into the file when the email is sent I have an HTML template saved as a file. Basically what I want to do is trigger a Welcome Email whenever a customer buys a product. The email body will be same as the HTML file saved. Currently, I am doing it the following way.
My cs file looks like this:
public Task<EmailResponse> SendEmail(EmailRequest emailObject)
        {
            var response = new EmailResponse();
            var smtpClient = new SmtpClient
            {
                EnableSsl = false,
                Port = 
                Host = ""
            };

            var Message = new MailMessage
            {
                Subject = ,
                From = new MailAddress(emailObject.FromEmail, emailObject.FromName),
                IsBodyHtml = true,
                Body = WebUtility.HtmlDecode(emailObject.Html)
                };
...
}


A: You could use SMTP.
SmtpClient smtp = new SmtpClient("yoursmtp.com");
MailMessage mail = new MailMessage();
mail.From = new MailAddress("xyz@xyz.com");
mail.IsBodyHtml = true;
mail.Subject = "Your " + Name + " User Access information";
mail.To.Add(obj.config.data.email);
mail.body = "<html><body><p>Hi" + " "+ obj.config.data.firstName + ","
+ "</p><p>Below is your user name and password to access the " + Name +" application.</p>....
smtp.Send(mail);

I would modify the way you are concatenating your strings. You could you 
$"Your {Name} User Access information";

And same thing for the body.
