title: How to configure Serilog to send email with message body in html format?
body: <p>I am using Serilog in my project based on dotnet core 3.1 and using its Email sink to send emails using Serilog. The version of serilog for email is :</p>
  <pre><code> &lt;PackageReference Include=&quot;Serilog.Sinks.Email&quot; Version=&quot;2.3.0&quot;/&gt;
  </code></pre>
  <p>I want to send email body to be in Html format. How to do it ? I have configured serilog to send mails through appsettings.json file in the below way :</p>
  <pre><code>{
    &quot;Name&quot; : &quot;Email&quot;,
    &quot;Args&quot; : 
    {
       &quot;fromEmail&quot; : &quot;&lt;emailId&gt;&quot;,
       &quot;toEmail&quot; : &quot;&lt;emailId&gt;&quot;,
       &quot;enableSsl&quot; : false,
       &quot;mailSubject&quot; : &quot;&lt;Mail Subject&gt;&quot;,
       &quot;isBodyHtml&quot; : false,
       &quot;mailServer&quot; : &lt;mailServer&gt;,
       &quot;smtpPort&quot; : &lt;port&gt;,
       &quot;outputTemplate&quot; : &quot;Error occured at - {Timestamp:HH:mm:ss}\nError Message :{Message:lj} &quot;,
        &quot;restrictedToMinimumLevel&quot; : &quot;Error&quot;
    }
  
  }
  </code></pre>
  <p>So according to above configuration, if error is logged using Serilog , a mail will be sent as well.
  Below is the code for logging Error level-</p>
  <pre><code>  _logger.LogError(ex,$&quot;Directory address is {address}&quot;);
  </code></pre>
  <p>I want to show this address as hyperlink. How to do it? Setting <b>isBodyHtml to true </b> doesnot help.
  After setting <b>isBodyHtml</b> to true, i change the error message in the this format :</p>
  <pre><code> _logger.LogError(ex,$&quot;Directory address is &lt;a&gt;{address}&lt;/a&gt;&quot;); 
  </code></pre>
  <p>But this does not help.</p>