title: Email from address changes when using MimeMessage and MailKit
body: <p>I am creating a contact us page in my .net core 2.2 MVC website, The form sends the details to a google mail account although I have noticed that the from address in the received email changes from the email address entered in the form to my google email address instead. </p>
  
  <p>Below is the Mailkit code I have been using</p>
  
  <pre><code>var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json");
  var configuration = builder.Build();
  var host = configuration["Gmail:Host"];
  var port = int.Parse(configuration["Gmail:Port"]);
  var username = configuration["Gmail:Username"];
  var password = configuration["Gmail:Password"];
  
  var mimeMessage = new MimeMessage();
  
  mimeMessage.From.Add(new MailboxAddress(name, fromAddress)); //Email address enter : test@gmail.com
  mimeMessage.To.Add(new MailboxAddress(configuration["ContactInfo:Email"]));
  mimeMessage.Subject = subject;
  mimeMessage.Body = new TextPart("plain"){ Text = message };
  
  var smtpClient = new SmtpClient();
  smtpClient.Connect(host, port, false);
  smtpClient.Authenticate(username, password);
  smtpClient.Send(mimeMessage);
  smtpClient.Disconnect(true);
  </code></pre>
  
  <p>However in the picture I have highlighted the from address and you will notice its changed addresses</p>
  
  <p><a href="https://i.stack.imgur.com/YlKd9.png" rel="nofollow noreferrer">Image of email sent from contact form</a></p>
  
  <p>I have tried to use the sender option within mimeMessage but it didn't changed anything. Also in the inbox list the name appears as 'me' and I'm unsure as to how this is happening. </p>
  
  <p>I am new to the whole .net core and mailkit so any help would be greatly appreciated. </p>