I think that Gmail is rewriting the from address and using the account that is provided in the network credentials for the from.
MailMessage message = new MailMessage();
message.From = new MailAddress("jimmy@gmail.com");
message.To.Add(new MailAddress("myacct@gmail.com"));
message.Subject = "[Yep] Contact Form";
message.Body = msg;
message.IsBodyHtml = false;
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = false;
NetworkCredential networkCredentials = new NetworkCredential("myacct@gmail.com", "pass");
client.Credentials = networkCredentials;
client.EnableSsl = true;
client.Host = "smtp.gmail.com";
client.Port = 587;
try
{
client.Send(message);
This is the received email:
From: myacct@gmail.com To: myacct@gmail.com Date: Sun, 23 Sep 2012 14:44:54 -0700 (PDT) Subject: [Yep] Contact Form Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable
This is a test
I know it use to work but now the from is always mine. Can I get a confirmation if everyone else is having this issue or is it just me?