Sending FROM address domain is not valid.
In another project, I create a frmEmail.aspx. In this page the same code is working fine. I am receiving email successfully. Code is
using (MailMessage mm = new MailMessage(txtEmail.Text.Trim(), txtTo.Text.Trim()))
{
mm.Subject = txtSubject.Text.Trim();
mm.Body = txtComment.Text.Trim();
mm.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
NetworkCredential NetworkCred = new NetworkCredential(txtEmail.Text.Trim(), "bwlxfduacdrfcabf");//txtPassword.Text.Trim()
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = 587;
smtp.Send(mm);
Response.Write("Email sent.");
}
but in another project it is not working and showing me error
Syntax error in parameters or arguments. The server response was: Sender domain is invalid. Could not find DNS record.