title: How to write Html in asp.net core web api , Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
body: <p>I want to send a message through email in ASP.NET Core 6.0 Web API.</p>
  <pre><code>public void SendMail(string password, string to)
  {
      var host = _config.GetSection(&quot;Email:HOST&quot;).Value;
      var port = _config.GetSection(&quot;Email:PORT&quot;).Value;
      var fromEmail = _config.GetSection(&quot;Email:Credentials:Username&quot;).Value;
      var passwordOfFromEmail = _config.GetSection(&quot;Email:Credentials:Password&quot;).Value;
      var toEmail = to;
  
      using (MailMessage mm = new MailMessage(fromEmail, toEmail))
      {
          mm.Subject = &quot;Your Secret Password&quot;;
          // mm.Body = &quot;Your Secret Password is &quot; + password;
          mm.IsBodyHtml = true;
  
          mm.Body = $&quot;&lt;p&gt;Your Secret Password is &quot; + password + &quot;&lt;/b&gt; To unsubscribe your account, &lt;form method=\&quot;post\&quot; action=\&quot;http://localhost:5000/api/newsletter-subscription/public/unsubscribe\&quot; class=\&quot;inline\&quot;&gt;  &lt;input name=\&quot;email\&quot; value=&quot;toEmail&quot;&gt; &lt;button type = \&quot;submit\&quot; name = \&quot;submit_param\&quot;  value =&quot;toEmail&quot; class=\&quot;link-button\&quot;&gt; Click Here   &lt;/button&gt; &lt;/form&gt;.&lt;/p&gt;&quot;;
  
          // removed rest
      }
  }
  </code></pre>
  <p>I got this error:</p>
  <blockquote>
  <p>Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement [Application]</p>
  <p>; expected [Application] at <code>value=&quot;toEmail&quot;</code></p>
  </blockquote>