Quote:
catch
{
Label1.Text = "Please wait..";
sendmail();
}
You are sending mail inside
Catch Block. Is that what you need? Rather just log the
Exception
in some
File or
Database, so that you can track why exactly it is failing to work as expected.
There must be some problems while sending the mail and it might be due to many reasons.
Firewall/AntiVirus blocking the port
587
is a very common issue.
Refer my answer -
sending email to gmail from asp.net[
^] and check if you are doing it correctly.
Once you log the
Exception
, you will be able to know the issue specifically. Then you can just search that Exception in
Google and try the solutions suggested.