I have difficult to change the "From" attribute value for the actual sender address, even I add it in the code, as below: (never mind what is added the From header shows my address, that I connect to SMTP server)
MailMessage m = new MailMessage();
SmtpClient sc = new SmtpClient();
m.From = new MailAddress(from, "Display name From");
m.To.Add(new MailAddress(to, "Display name To"));
m.Subject = "Test1";
m.IsBodyHtml = true;
m.Body = " This is a Test Mail";
m.ReplyTo = new MailAddress(from);
MailAddress bcc = new MailAddress(to);
m.Bcc.Add(bcc);
sc.Host = "smtp.gmail.com";
sc.Port = 587;
sc.Credentials = new System.Net.NetworkCredential("google@gmail.com", "password");
sc.EnableSsl = true;
sc.Send(m);
I will appreciate if anybody will help me with the issue