title: How to Send Email with query string value in a link
body: <p>We are sending Email with query string value. But querystring value in a mail not showing in activation Link:</p>
  
  <pre><code>msg.Body = "&lt;a href=\'http://www.example.com/SignUp.aspx?nyckel= uniqueid'&gt;Click&lt;/a&gt;";
  </code></pre>
  
  <p>Here uniqueid is random generated value, and random generated value not showing in a Link.</p>
  
  <p>Link in Email (<a href="http://www.example.com/SignUp.aspx?nyckel=" rel="nofollow noreferrer">http://www.example.com/SignUp.aspx?nyckel=</a> uniqueid), showing in place of
  (<a href="http://www.example.com/SignUp.aspx?nyckel=" rel="nofollow noreferrer">http://www.example.com/SignUp.aspx?nyckel=</a> XXXXXXX).</p>
  
  <p>Here is the code:</p>
  
  <pre><code>public static void sendMail(string Email, string uniqueid)
      {   
          uniqueid = GenerateRandom.GetUniqueReferalid(14);
          MailMessage msg = new MailMessage();
          msg.From = new MailAddress("Admin");
          string _toId = Email.ToString();
          msg.To.Add(new MailAddress(_toId));
          msg.Subject = ("Refer a Friend");   
          msg.IsBodyHtml = true;
          msg.Body = "&lt;a href=\'http://www.example.com/SignUp.aspx?nyckel=uniqueid'&gt;&lt;/a&gt;";
          SmtpClient client = new SmtpClient();
          client.EnableSsl = true;
          client.UseDefaultCredentials = true;
          try
          {
              client.Send(msg);              
          }
          catch
          {                
          }
  </code></pre>