So I've been having issues with the contact page on this site.? After looking around, I tracked the problem to the Send button handler code.? It would apparently only send email if there was an attached file.? Since my contact form has no ability to attach files, it didn't send emails.
That sucks.
A broken contact page is the worst problem you can have with a website (short of the site going offline), because your visitors can't even tell that it is broken.? Even worse, if the page indicates success but doesn't send it, your visitors won't even know there is a problem, and neither will you.? Yet another good reason to run through and test your sites functionality every once in a while.? That is also why I include my email address (brian@codeinreview.com) on each page, which is apparently what folks have been using to get in touch with me.? So for everyone that tried the Contact page, I'm sorry.
Fortunately the fix was easy, I just commented that check out of the button handler code in the contact page and we were back up and running.?
? private void btnSend_Click(object sender, EventArgs e)
? {
??? if (IsCaptchaValid && Page.IsValid)// && txtAttachment.HasFile)
??? {
????? bool success = SendEmail(txtEmail.Text, txtName.Text, txtSubject.Text, txtMessage.Text);
????? divForm.Visible = !success;
????? lblStatus.Visible = !success;
????? divThank.Visible = success;
????? SetCookie();
??? }
? }
I'm not really certain why that check was in there in the first place, I couldn't see any reason for it.? It would also be nice if there was some feedback as to what failed here – but for now that will need to wait until I better understand what is going on.
In looking into this fix, I also discovered that several other people have had issues with the contact form in blogengine.net.? If my hack doesn't fix the problem for you, check out these changes.? Maybe they will do the trick…
Good luck…