Discussion on Asp.net Contact Form - HTML Email (Bootstrap Edition)

mimtiyaz

mimtiyaz supports this item

Supported

This author's response time can be up to 1 business day.

20 comments found.

Does this send an email to me (the administrator of the form/website) or to the person filling out the form?

When any user tries to contact, an email will be sent to the user and admin as well.

I’m quiet a beginner at this. Unfortunately the help docs provide no real help. Can this form be placed within my regular bootstrap page (ie contact.html)? If so what code do I put there? Is there anything else that I need to be aware of?

Thank you

You need to follow these 3 simple steps

Step 1:
Configure your SMTP settings in your web.config file located in the root directory of your web application.
< smtp deliveryMethod="Network" from="info@domain.com">         
< network defaultCredentials="false" 
                   host="domain.com" 
                   userName="info@domain.com" 
                   password="yourpassword" 
                   port="25"/>         
< /smtp>
info@domain.com will be the email of your website
domain.com will be your domain
Step 2:
From Default.aspx file
  • Copy the HTML script from BEGIN Container to END Container. You can add or remove text as per your needs.
  • Copy the HTML script from BEGIN JavaScript to END JavaScript. Don’t customize anything here in this area.
Step 3
From Default.aspx.cs file
  • Add the following namespaces
    1. using System.IO;
    2. using System.Net.Mail;
    3. using System.Web.UI;
  • Copy the C# script from #region Send Email to #endregion
That’s all…

Very nice, GLWS!

Thanks

When opening the solution in VS 2015, I’m getting an error that the project cannot load, and to check the output window. The output window is showing the following error “Error opening web http://localhost:51106. Unable to open the Web site ‘http://localhost:51106'. The Web server ‘http://localhost:51106' could not be found.”

In Visual Studio 2015 go to File-Open Web Site, point it to the directory where your website is located. Once the project is opened, click F5 and see if it works.

Opening as a Web Site solved the issue

Hello,

How can I fix the email address the form is received. Now the form is going to email which is filled in the email field.

Thank you

Could you be more specific please

When somebody send form I want to receive the result only one mail adress. I want to receive the results to the same emil always. Now somebody get form results who send it.

To receive email as acknowledgement to the sender, simply add message.Bcc.Add(“youremail@domain.com”); after message.To.Add(txtEmail.Text.Trim().Replace(”’”, ”’’”)); in your C# code.

I couldn’t find the style.css, where is it?

Refer to the reply mentioned above. :-)

Where can I add; message.Bcc.Add(“youremail@domain.com”); after message.To.Add(txtEmail.Text.Trim().Replace(”’”, ”’’”)); in your C# code.

in default.aspx ?

In Default.aspx.cs

hi,

if i want to use just the captcha, is it possible?

I have a quote widget here https://www.budgetdirect.com.sg/car-insurance and I’m using ReCaptcha. I wanted to try a simplified version but a solid one that will block automated bots from trying to pass through the form.

Can your code blocked bots?

Is it possible for you to provided an updated code that only requires me to add just the captcha into my own form?

Okay, can block the bots and update the code? if so, i’ll purchase the tool.

Hello,

How to clear all fields after sending of information from form?

Regards Eugenij.

Hello

You can clear form fields after the form submission by adding the script mentioned below

After reader.Dispose(); add the following script

txtName.Text = ””; txtEmail.Text = ””; ddlSubject.SelectedValue = “0”; txtMessage.Text = ””;

Thanks, mimtiyaz

I am looking at your product and looks really nice and I like that it is tied in with bootstrap. I am also looking at using this on a site that is powered by AspDotNet Storefront, would your form work on there as well?

Thanks

Will this also work in AspDotNet Storefront?

If the Storefront runs on .NET Framework then you can integrate this product in it.

ok great

When I try and submit form, I get an error saying please confirm you are not a robot and the recaptcha seems to refresh, I already have the site key added. Also how can I add this to an already existing aspx page rather than creating a separate page for this form.

Thanks

is this on default.aspx or default.aspx.cs

The form controls are in Default.aspx and the C# code i.e., button submit event is in CodeBehind page (Default.aspx.cs)

when I comment out the codebehind I get a runtime error

removed…

ok sent you an email

I get error failure sending mail when trying to send a message with form, I was trying using gmail smtp setting, I have also tried a new host, new port, new username and password and still get the same error

form not working

Help to get this working please!!

I purchased this form, with multiple days of attempts and working with host and author this form doesn’t work…be careful and cautious if thinking about purchasing this form!

Set customErrors mode=”Off” in web.config file so that I can see the exact reason behind this error.

I have posted and updated the files on the server so you can see errors. Thanks

What now?????

I purchased the bootstrap contact form. However I do not want it to email the user submitter only show a message, I want to be the only one to receive any email from the contact form. How would I prevent the submitter from receiving email?

Ok I will give it a go. I wanted to make sure.

That works fine. thanks. However the form clear fields txtName.Text = ””; txtEmail.Text = ””; ddlSubject.SelectedValue = “0”; txtMessage.Text = ””; mentioned above throws and error.

The problem is the clear string had open and close quotes versus ”” quotes. change them all to ”” and it works fine. I am guessing it’s the comments CSS that is changing them form standard quote marks.

The name ‘txtName’ does not exist in the current context mimtiyaz C:\PTL\ecb\MailForm\mimtiyaz\Default.aspx.cs

One of a series of field names that are not found.

Try to debug the code, you’ll be able to see the form controls with their input values.

I set up a new aspx file and copied the content to it. The new one worked, I think it was a version difference.

A separate problems, from a site sharing an IP address with others via Host Names, I could not get reCaptcha to validate. I changed to a dedicated IP and now it is working. Does that match your experience?

Hi, when i open the solution i have this error:

http://localhost:49550 : error : Errore durante l’apertura del Web http://localhost:49550. Impossibile trovare il sito Web ‘http://localhost:49550'.

Error open the web project.

You have the VS2013 solution without configure the web?

Thanks

Hi,

In Visual Studio go to File > Open > Web Site, point it to the directory where your website is located. Once the project is opened, click F5 and see if it works.

Harties

Harties Purchased

Hi, Purchased contact form earlier today. After download and unzip, I have tried both Contactform and the contactform helpfile projects. Both give me a similar error. I am pasting error from helpfile program. http://localhost:51982 : error : Error opening web http://localhost:51982. The Web site ‘http://localhost:51982' could not be found. I am using Visual Studio 2017

Hi, In Visual Studio 2015 go to File-Open Web Site, point it to the directory where your website is located. Once the project is opened, click F5 and see if it works.

by
by
by
by
by
by