title: Running a background task for sending emails when a user posts to a discussion board in ASP.NET CORE
body: <p>I need to send emails via SMTP to all subscribers of a discussion board. If there a lot (say 1000+) subscribers, I do not want the users who posts a new post to have to wait while the notification emails are being sent out. </p>
  
  <p>At first I thought I could use: <code>System.Net.Mail.SmtpClient.SendMailAsync</code></p>
  
  <p>But, as <a href="https://stackoverflow.com/questions/20129933/sendmailasync-use-in-mvc">this post explains</a>, <em>"Async is not a magic wand that makes the action return the response quicker. Your task (in this case, sending an email) takes as long as it takes and async or not, the action will not return a response until the task has completed."</em> Async is more about being efficient with threads than it is about making a task run faster. </p>
  
  <p>First, is my research about SendMailAsync correct? I don't think it is a correct solution.</p>
  
  <p>Second, what would be a way to achieve my goal? A <strong>background task</strong>?
  I've heard of <a href="http://hangfire.io/" rel="nofollow noreferrer">Hangfire</a>. Is something like Hangfire what I need to use? Or could I just use <strong>an AJAX call</strong> to send the emails?</p>
  
  <p>Btw, I'm using ASP.NET Core and .NET Framework 4.6.1</p>