27 comments found.
Good luck with your sales
I recently purchased your asp.net contact us form/code, and I’m having some issues with the email relay portion. Captcha appears to be working okay, but when I try to send through Office 365, the screen form submission just flashes with no result one way or another, and the email is never sent. I’ve updated the web.config file for smtp.office365.com with SSL enabled and the correct username and password, but it doesn’t seem to work.
I’d try to debug it through Visual Studio, but the solution won’t load in VS 2019, so I’m at a dead end, and I’m hoping you can offer some quick advice.
Thank you.
Hello
Usually, this issue arises when the SMTP in web.config is not configured properly. Check out the prerequisites if smtp.office365.com is used.
https://www.netwoven.com/2015/12/24/smtp-relay-for-office-365exchange-online/
https://adamtheautomator.com/office-365-smtp-relay/#Prerequisites
Hope this will fix your issue.
I am getting the ‘Please confirm that you are not a robot’ error and no email is being sent. I’ve put my site key in the default.aspx and default.aspx.cs, where indicated by “[YOUR SITE KEY]” but inside the quotes and w/o the brackets.
You need to specify the site key within the quotes (No brackets are required).
Yes, as I said, I’ve done that but still get the error
BTW, thank you for the prompt response. I just tried it now using the secret key instead of the site key in the default.aspx.cs and got a ‘Faulure sending mail’ error.
... and just tried commenting out the recaptcha code per your suggestion to the unfortunate mr. pdeignz and also got the Failure sending mail’ error. The mail is handled by gmail, fwiw and I’d be sure I have my webconfig in order but the clouds of doubt are darkening…
...tried updating the jquery and adding the EnableSsl = true per mr. WebWaxNet, still same error
Ah, think I may have got it, changed webconfig host from gmail.com to smtp.gmail.com
And then, figured out that I had to use (and modify) the Email_v2.0.html, after googling StreamReader. Looking back, i see you only claim this has ‘simple code’, not that it is easy for dummies to use. FWIW, I think you’d pick up some more sales if you wrote up some new, detailed instructions for the ignorant masses, folks such as myself. Perhaps it’s not worth the return but this was by far the best looking option I ran across when needing a form for my simple sites. Ok, back to work, see if I can finish this up today…
FWIW to future stumblers, the last hurdle was, since I was using gmail, they were blocking it as mail from an unknown device, so logging into my server and signing in to the gmail account from there let me get that approved. It seems to all be working fine now.
Great!
Pretty sure this is just my lack of experience but if you can help me here, I would gladly post my docs for implementing this, and maybe it would help some other dufus in a similar situation…
I’m trying to test this in a VS 2019 ASP.NET Web Application C# before implementing it in a new site. The simple instructions didn’t work so I’ve been trying to sort out the issues one at a time, I think I’m getting close.
When I click on my Conatct.aspx page, the current error I get is is: ‘CS1061: ‘contact_aspx’ does not contain a definition for ‘btnSendEmail_Click’ and no accessible extension method ‘btnSendEmail_Click’ accepting a first argument of type ‘contact_aspx’ could be found (are you missing a using directive or an assembly reference?)’
I don’t see any references to btnSendEmail_Click in your solution that aren’t in mine, so I’m assuming I’ve missed an important step somewhere else.
Also, in VS’s Error List, there is: ‘CS0103 The name ‘reCAPTCHA’ does not exist in the current context’, referencing a line in my Contact.aspx.cs file.
I’ve copied your reCAPTCHA.cs file from your App_Code folder and tried it both in there and in my App_Start folder, same result.
In VS, when I hover over ‘reCAPTCHA’ I get the potential fixes list, which suggest creating various internal or private classes, whereas in your reCAPTCHA.cs, it’s a public class, so I’m thinking my solution hasn’t actually run my reCAPTCHA.cs.
Additional info: - In my Contact.aspx page, I copied over your Container and JavaScript sections, per instructions but commented out the <script src=”... lines as they load in my Site.Master - In Global.asax.cs, I added: ScriptManager.ScriptResourceMapping.AddDefinition(“recaptcha”, new ScriptResourceDefinition { Path = “https://www.google.com/recaptcha/api.js” }); - And then in Site.Master, ScriptManager, I added: <asp:ScriptReference Name=”recaptcha” />
I don’t know if the reCAPTCHA and btnSendEmail_Click errors are related but I’m hoping you’ll have an idea or maybe can point me to where I should be doing more research to sort this out. I think this could be my go-to contact form solution for several sites if I can get it to go.
Thanks much.
I may have solved this, changed the properties of reCAPTCHA.cs Build Action from Content to Compile. It’s running now.
Hello,
Am I able to place this in my regular HTML page?
Currently, even navigating to the Email_v2.0.html file doesn’t show me the form.
Thanks in advance
I’m unable to access the URL which you’ve shared.
Can this be done using the System.Net.Mail my hosting will not let this go through
How do you tie this using Office 365 mail client? I have added smtpClient.enableSSL=”true” and that allows communication but I get an error of 5.3.4 554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 16.55847:69000000, 17.43559:0000000060010000000000000000000000000000, 20.521
Actually I found a post that claims Microsoft simply doesn’t allow this functionality
Final update, I contacted Microsoft and they were kind enough to walk me through the process of tying this form to Office 365! It can be done and works great! I did have to add a param for smtpClient.EnableSsl = true; to enable TLS of course, for me line 53 just before .Send(message) on default.aspx.cs. I then followed the instructions from the MS URL to send via client. https://docs.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-office-3
Final step was to add jquery-3.3.1.js to the js folder and update the link on line 112 for Default.aspx. That did the trick!
up and running and working great!
Wonderful job on the code and the form!! 
That’s great
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.
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.
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?
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?
Hello
The concept is similar to the way we compose an email in our routine activity. Just comment the lines of code to avoid sending email to other users. Have a look..
message.To.Add(txtEmail.Text.Trim().Replace("'", "''"));
//message.Cc.Add("yourname@domainname.com);
//message.Bcc.Add("yourname@domainname.com);
Hope this will help you.
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.
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!
Dear,
Let me tell you something, you purchased the product, I gave you the support. I’ve spent hours on the issue which is irreverent to the support. If you want me to work on your personal issues, then how could I do that? I personally had a conversation with the hosting service provider team though it was not my responsibility.
The issue is not from my script, in fact the issue is SMTP settings which is supposed to taken care by the hosting team. You were not even aware of how to comment the lines of code still you are blaming me, it’s not right. The product is sold to other customers are well but so far no one complained me about this issue, you are the one who are giving this kind of feedback.
A humble request, don’t purchase any product unless you know how to use it or else don’t blame the authors.
Thank you,
mimtiyaz
You are wrong as I use settings not only from Google but also multie hosting companies, not once did your form work. The fact is your form doesn’t work or you don’t provide adequate support for people to get it to work and only works for you…your product is no good and doesn’t work!
Again I’ll remind you, I can assist you for the issues related to the product but please don’t expect any kind assistance other than the product.
Just have a look at the conversation I had with the hosting company on behalf of you:.
2:04:19 AM System Vivekananda S has joined the chat! 2:04:33 AM Vivekananda S Hi Imtiyaz. My name is Vivekananda. How are you today? 2:04:46 AM Imtiyaz Hi 2:05:12 AM Vivekananda S Could you please provide me with the Support Code which you can obtain from your client area at the URL customers.arvixe.com/clientarea.php under the Support Options. 2:05:17 AM Imtiyaz Actually I’m facing an issue with smtp setting 2:06:02 AM Imtiyaz <smtp> <network host=”pdesignz.com” userName=”paul@pdesignz.com” password=”webman01” port=”25” />
</smtp> 2:06:26 AM Imtiyaz I’m using the above mentioned script in my web.config file to send emails to customers 2:07:18 AM Imtiyaz but I’m getting an error SMTP Server requires a secure connection or the client was not authorized.. 2:07:43 AM Vivekananda S Alright, let me check it. 2:07:48 AM Vivekananda S Could you please provide me with the Support Code which you can obtain from your client area at the URL customers.arvixe.com/clientarea.php under the Support Options. 2:09:36 AM Imtiyaz Actually I’m talking to you on behalf of my client. Let me ask him the code 2:10:21 AM Vivekananda S Okay. 2:12:03 AM Imtiyaz 147154-543558 2:13:32 AM Vivekananda S Thank you for authentication. 2:14:23 AM Vivekananda S Please try host as ‘dandelion.arvixe.com’ 2:15:42 AM Imtiyaz Still the same issue 2:15:44 AM Imtiyaz 2:15:54 AM Vivekananda S Could you please let me know the exact URL where you are receiving the error message? 2:17:07 AM Imtiyaz as of now, it’s on my local computer for testing purpose. 2:17:34 AM Vivekananda S Okay. 2:19:57 AM Vivekananda S Please try host ‘dandelion.arvixe.com’ with port 465 2:23:29 AM Imtiyaz It’s taking much time to load.. 2:24:58 AM Vivekananda S Try this port 587 2:26:18 AM Imtiyaz 587: same issue 2:27:24 AM Imtiyaz 465 is taking much time to load 2:27:25 AM Imtiyaz 2:28:14 AM Imtiyaz What’s the issue.. 2:28:52 AM Vivekananda S I don’t any issue with the server. 2:29:37 AM Imtiyaz I’ve tried with other domain, it’s working fine for me. I’ve issue only with this domain 2:33:42 AM Imtiyaz are you there? 2:33:52 AM Vivekananda S The other domains are hosted with us? 2:34:03 AM Imtiyaz No 2:35:22 AM Vivekananda S Please try port 26 2:36:15 AM Imtiyaz same SMTP issue 2:38:40 AM Vivekananda S Alright, let me check it. Please be on hold for 3-4 minutes. 2:39:00 AM Imtiyaz sure 2:44:35 AM Vivekananda S Thank you for your patience, I was not able to get to the root cause of the issue. So, I will be escalating this issue to one of my senior specialists who will be investigating on your concern and will provide a permanent fix for it. I have also handed over all my findings to that specialist. 2:44:45 AM Vivekananda S I have successfully created the ticket for you. Your ticket ID is LAD-727-12441 2:46:02 AM Vivekananda S Is there anything else I could assist you with today Imtiyaz? 2:49:29 AM Vivekananda S Did you receive my last message? 2:51:52 AM Vivekananda S Are we still connected? 2:54:25 AM Imtiyaz yes 2:54:27 AM Imtiyaz 2:55:01 AM Vivekananda S Is there anything else I could assist you with today? 2:55:20 AM Imtiyaz How much time do you think it would take? 2:55:28 AM Vivekananda S Unfortunately, I do not have an estimated time frame I can give out as to how long this will take, but I assure you our administrators will have it done as soon as humanly possible. 2:55:58 AM Imtiyaz Okay… anyways, thanks for your assistance
As I have told you before, my email is done via Google not my host! I have also gone ahead and created an email for another domain on the server, using host settings they say to use your script does not work
Being a programmer or developer at least you should recognize the basic issues. Even after assisting you, you stick to your own words then what is the use of assisting you.
I have done what you said, changed setting to hist suggestions butbyiur form still won’t work!
The hosting company is accepting the fact that the issues is from them, then why don’t you..?
I am going to try this again, before I purchase another asp.net form on envato, I downloaded the files, extracted and then uploaded to server without opening files or making any changes, server is running .net 4.0, I posted all files and folders in the source folder except for the solution file, when I try and load the page that has not been modified from the source I get Server Error in ’/’ Application. Runtime Error Description: An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated.
I want to try and see if it’s possible to get the form working before I purchase another form here on envato…looking for help or suggestions, you can visit page here…www.pdesignz.com/contact
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?????
Help to get this working please!!
removed…
Kindly do not post the scripts in the comments section.
I have tried multiple times and every time I comment out the codebehind for the captcha and then go to the form page I get a runtime error and page won’t load…if I uncomment and then go to page the page loads
Just make sure to comment the if else condition in the code.
I am commenting here…is there elsewhere I need to comment out
//string reCaptchaSecret = “[YOUR SITE KEY]”; //string reCaptchaRequest = ””;
//if (Request.Form[“g-recaptcha-response”] != null) { reCaptchaRequest = Request.Form[“g-recaptcha-response”].ToString(); }
//if (reCAPTCHA.CheckReCaptcha(reCaptchaSecret, reCaptchaRequest))
Doing this seems to break the page Description: An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated.
Runtime Error
also you need to comment the closings tags of if else condition
where would I do that
I tried this…
//string reCaptchaSecret = ””; //string reCaptchaRequest = ””; //{ other code… //} else
//if (Request.Form["g-recaptcha-response"] != null) { reCaptchaRequest = Request.Form["g-recaptcha-response"].ToString(); }
//if (reCAPTCHA.CheckReCaptcha(reCaptchaSecret, reCaptchaRequest))
still throws a runtime error
ping me from your email
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
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
If I want to remove the terms or captcha, what would need to be done
The main purpose of reCAPTCHA is to avoid the webpage being controlled by the bots rather than humans. Once the page is submitted, you need to again validate the reCAPTCHA to submit the form again.
To copy the code in any existing web site you need to copy the form controls you need from Default.aspx and the submit button event code from CodeBehind (Default.aspx.cs)
If you want to remove the terms or reCAPTCHA, simply comment the if else condition in button submit event.
//string reCaptchaSecret = "[YOUR SITE KEY]";
//string reCaptchaRequest = "";
//if (Request.Form["g-recaptcha-response"] != null) { reCaptchaRequest = Request.Form["g-recaptcha-response"].ToString(); }
//if (reCAPTCHA.CheckReCaptcha(reCaptchaSecret, reCaptchaRequest))
//{
Your code here..
//}
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
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
Firstly thanks for your appreciation. Yes, you may integrate this product in your existing Asp.Net web application.
Will this also work in AspDotNet Storefront?
If the Storefront runs on .NET Framework then you can integrate this product in it.
ok great
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
hi,
if i want to use just the captcha, is it possible?
Yes, it is 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
Okay, can block the bots and update the code? if so, i’ll purchase the tool.
I couldn’t find the style.css, where is it?
For better understanding a style.css is linked in the Default.aspx page though it is not required, you can still create your own style.css file if needed.
How can I make setup for to send form always same email (admin email)?
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
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.