title: How to use Blazor to send email thru Azure website
body: <p>If I am creating a Blazor App base on Asp.net Host template and I have a paid subscription for Azure. I would like to know how to send an email when user have entered the required info.<br/></p>
  
  <p>Here the code for Asp.netCore and I am not sure how to use it for my case using Blazor to send thru Azure website. Would appreciate if you can provide some reference to read or a sample code to try out.
  Thanks</p>
  
  <pre><code>using System.Net.Mail;
  
  MailMessage mailMessage = new MailMessage();
  mailMessage.From = new MailAddress("email1@somewebsite.com");
  mailMessage.To.Add(new MailAddress("email2@somewebsite.com"));
  mailMessage.Subject = "Your subject";
  mailMessage.IsBodyHtml = true;
  mailMessage.Body = "Email body";
  SmtpClient client = new SmtpClient();
  client.Credentials = new System.Net.NetworkCredential("email1@somewebsite.com", "password");
  client.Host = "smtpout.asia.secureserver.net";
  client.Send(mailMessage);
  </code></pre>