1

I am trying to debug a problem on a wordpress website I am working on. The contact form doesn't work. In my quest to find answers it occurred to me that I don't even actually know what's going on in the background in order to understand the sites that I'm reading for help!

So basically my question is: what happens when someone submits a form on a website?

I see that my hosting company has provided me a mail box with some arbitrary email address where the form submission gets returned to when it fails. Why? Do all form submissions actually come from this email address? What does PHP or SMTP have to do with this?

  • "I see that my hosting company has provided me a mail box with some arbitrary email address " what is the part to the left of the @ symbol? – Steve Jul 7 at 2:26
2

First, click and submit events first on the submit button and form. These can trigger JavaScript which can completely change or replace the next step.

Then an HTTP request is made (using the method specified in the form's method attribute) to the URL specified in the form's action attribute.

The server receives the request and processes it. This might involve running a program. This program can be written in any programming language at all. PHP is one option.

That program might send an email. It might use the Simple Mail Transfer Protocol to do this directly. It might shell out to a local program like sendmail. It might use a webservice like Sendgrid.

I see that my hosting company has provided me a mail box with some arbitrary email address where the form submission gets returned to when it fails.

That doesn't really make sense.

Perhaps that is the mailbox where the email's From address resolves do, so if the email bounces it will end up there. That isn't "the form submission" though, its several steps down the line from it.

| improve this answer | |
  • I see. In light of this information I think I left out some vital details. I am working on a wordpress site. I guess wordpress would have some standard functionality where there's a contact form on the website... – Dee Jul 6 at 15:18
  • WordPress has no built-in contact form functionality. There are numerous plugins which provide that feature, you might be using one of them. – Quentin Jul 6 at 15:21
  • Yes. But they all seem pretty straight forward with no back end tinkering involved. I am only tinkering now because apparently the hosting company causes some issue which prevents the form working. I think I'll have to ask this question on some wordpress-specific platform. – Dee Jul 6 at 16:08
0

Lots of reasons why an email won't make it. Sysadmins try to tie as many things down as possible. Things to check would be:

  1. Check /var/log/mail. You can grep for a specific email address, e.g.: "grep -r 'myemail@email.com /var/log/mail/"

  2. Make sure Sendmail is running

  3. Run phpinfo(); and search for "mail" parameters to make sure they're up

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.