title: How to use any email address in the FROM field while sending email through Gmail SMTP?
body: <p>I'm trying to send an email using gmail SMTP in C# using the code bellow</p>
  
  <pre><code>MailMessage message = new MailMessage();
  message.To.Add("my email");
  message.Subject = "subject";
  message.From = new MailAddress("any email");
  message.Body = "body";
  
  message.Attachments.Add(new System.Net.Mail.Attachment(path));
  SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
  smtp.EnableSsl = true;
  smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
  smtp.UseDefaultCredentials = false;
  smtp.Credentials = new System.Net.NetworkCredential("my user", "my pass");
  
  smtp.Send(message);
  </code></pre>
  
  <p>When I receive the email, the <strong>FROM</strong> field is filled with <code>my user</code>. I'm using <code>UseDefaultCredentials</code> as <code>false</code>. When I look to the result, the <strong>FROM</strong> field is filled with <code>my user</code>. Shouldn't the <strong>FROM</strong> field be filled with <code>any email</code>? How can I send an email using <code>any email</code> as sender?</p>