I am facing an issue when i send email from my ASP.Net application. There is no error in sending mail, but when the email is received by the recepient, the from email address shown is actually the username of network credential.
In my case, I am using smtp.gmail.com as smtp host and the user name and password are also of my gmail account.
MailMessage mail = new MailMessage(); mail.From = new MailAddress("abc@mydomain.com", "Enquiry"); mail.To.Add("munjal.pandya@yahoo.com"); mail.IsBodyHtml = true; mail.Subject = "Registration"; mail.Body = "Some Text"; mail.Priority = MailPriority.High; SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587); //smtp.UseDefaultCredentials = true; smtp.Credentials = new System.Net.NetworkCredential("xyz@gmail.com", "<my gmail pwd>"); smtp.EnableSsl = true; //smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.S ...

Go to the complete details ...