Kirupa.com - Creating an E-mail Contact Form

by kirupa | 11 November 2011


This is a companion discussion topic for the original entry at http://www.kirupa.com/html5/creating_email_contact_form.htm

hello ,i did same what you have told to create contact form but it doesn’t work…please help me.I cant understand whats problem there.

Can you provide more details such as what error you are receiving? Your question currently is very vague :smile:

hi…actually when i click on submit button in contact form…php file starts to download and stopped.It doesnt sending mails on given id.i cant understand what happens.can u tell me the reason…

It sounds like you haven’t installed PHP on your server.

ok fine i 'll try,installing php on server .

thanks very much for ur support.

Creating Email Contact Form execute successfully, but Email data not send email id.

Creating Email Contact Form and executed successfully, but Email data not send on email id.
and in your form if all fields are blank and we click on submit button then we also go on confirmation.htm page.
Please help me to solve this.

Did you check that your e-mail is Working or Not ? :sunglasses:

Rupinder - the e-mail not getting sent could be a misconfiguration on the server. Have you ever been able to use PHP to send an e-mail?

Regarding your second question - look into this page for details: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation. More specifically, the required attribute can help.

Cheers,
Kirupa :smile:

Really love the simplicity of this form. I didn’t it could be done into such few lines of codes. But since this is little outdated now, here is a more latest version of contact form in php and html: https://www.cloudways.com/blog/custom-php-mysql-contact-form/

Thanks for sharing your version. This tutorial is a bit out-of-date haha :stuck_out_tongue:

Hello,
I am trying to set up a contact page for my website - i found your easy contact page and set it up just the way your did - I uploaded it to the web server, I fill out the form & hit submit and the mailer.php downloads & it never sends the email nor get the auto-reply.

Thanks in advance,
Dave

Do you have PHP enabled on the server?

I’ve tried to implement your procedure to try it out on a test website. Everything appears to be setup correctly but when I hit send/submit - I get an syntax error. LIke this: Parse error : syntax error, unexpected ‘@’ in /data/9/1/139/34/1791849/user/1938916/htdocs/mailer.php on line 3

This line 3 is the email address line, which of course SHOULD have the @ symbol. I’ve checked the code and the syntax is properly formatted the same as what you provided.