I'm trying to send an email using c# App, the next code is working.
SmtpClient MailClient = new SmtpClient("smtp.gmail.com");
MailClient.EnableSsl = false;
MailClient.Credentials = new NetworkCredential("Ryan.White", "Password");
MailMessage Msg = new MailMessage();
Msg.From = new MailAddress("Sender.name@gmail.com");
Msg.To.Add(new MailAddress("Ryan.White@gmail.com"));
Msg.Subject = "testSub";
Msg.Body = "testBody";
MailClient.Send(Msg);
But Gmail's SMTP server puts gmail e-mail address (Ryan.White@gmail.com) as the sender,
regardless the MSG.FROM address (Sender.name@gmail.com).
Is it possible to send an email and control the sender address using C#/.NET ?
Or alternatively send an email without authentication?
I know that in UNIX you can control the sender address in 'Mail' command.