Introduction
Using a contact form on your website is very useful as it helps your web site visitors to communicate with you in an easy and simple way. But, there are spammers and hackers who are looking for exploitable web forms. It is essential to secure your form against all 'holes' that those hackers are searching for .
If you are not validating your form fields (on the serve side) before sending the emails, then hackers can alter your email headers to send the bulk unsolicited emails.
In this article will give tutorial how to create contact Us page with below key features.
Key features
- Contact Us form
- Validations
- Send Email
- Use of Captcha to avoid Spam
Contact Us Form Page
Validating Captcha Image and Send Email
Below example will show you how to validate captcha Image before sending an Email to avoid spam mails.
first off you must import using System.Net.Mail; namespace. Then define new SMTP email and collect all the information user entered in your webpage. Finally send all the information to recipient as an email.
Download the source code for more details.