PHP Contact Form

I am creating a simple Contact Form using HTML, CSS and PHP. The PHP is to actually get the form working. It should send the user message to my email. Will Netlify handle this PHP and make the form functional? Thanks.

Although Netlify does allow for the running of PHP code at the time of build, there is no php runtime on the CDN, so there will be no php endpoint to process your submission.

You can use Netlify Forms or use an external provider or endpoint.

Thanks for your response. I started looking at this option:

Is this basically the same thing that Netlify Forms offers? If yes, I probably should just use Netlify for my small site.

Hi, @Engine44, you can set up a backend form handler using AWS Lambda and direct form submissions there if you want to (which I believe is what that article is about). This does work with a site hosted at Netlify also.

We also offer our Forms feature if you prefer that solution.

If there are other questions about this, please let us know.

1 Like

Thanks. How is the Netlify Forms feature different from the AWS Lamda method? What are the pluses and minuses?


With Lambda you can write any code you want, so you can taylor it to your needs. In addition it might end up being more affordable for you if you receive a lot of submissions. Netlify forms is easier to use, does not not require you to write any custom code, and also automatically stores the form submissions in our database as well as runs spam filtering on submissions for you as well.

For a simple contact form, I can highly recommend Netlify Forms indeed!

This is interesting, is there a tutorial or better yet, a video about what’s the difference between lambda form compared to php sendmailform ? can it have server side validation?

Hi, @jonhdoe, these most recent questions about differences between two different software solutions, neither of which can be hosted on Netlify.

We don’t support any server side PHP directly. It is possible to use PHP backends/APIs with frontend sites hosted on Netlify but those backends won’t be hosted with our service. Any server side PHP code will have to be hosted with a different service. We can answer questions about Netlify but not about code hosted elsewhere.

Our support team has limited time to answer many questions so we can only address questions which are specific to Netlify. While it is possible that someone else here on this community site might answer this, you may find that asking this question somewhere more general (like Stack Overflow) will result in faster answers.

In other words, because this question is no longer about Netlify itself our support team won’t be able to answer but someone else might.