Contact Form endpoint?

Extern an endpoint on a certain port that will securely (maybe using task queue integration) send emails received from website’s contact form.

So Hugo is a static site generator and the server is for development purposes only, so I don’t think this feature makes a lot of sense :smile:

That said, there are plenty of form solutions out there that allow you to embed forms inside static pages:

Note too that many on the forums use Netlify to host their static sites—this is my personal favorite as well. Even their free tier includes some really easy-to-set-up forms.


We use for one project Mailjet. It has an API to send emails. Maybe you can implement one of this API’s in Hugo to send emails from a contact form. If the answer yes, please send my an email.

Here is a link to the API.

Don’t forget Basin; they offer unlimited form submissions per month for free. You can do more for free with Basin than other alternatives listed in this post, and for what it’s worth I’m a happy (free) user. :slight_smile:

1 Like

Well, off course there are third party alternatives. The problem with that is that you don’t know if someone reads these emails and free plans almost never going to satisfy you. And I’m bringing this up because the implementation of a simple smtp server is no more than 50 lines of code (in python), and there are golang send mail implementations already. This way everything stays internaly within your application and free - so why don’t expose an endpoint on hugo that is configurable from config.toml to handle contact form requests?

But what you’re suggesting here has, unfortunately, an enormous overhead. Sure, writing the Go code for an email server is easy. But that’s just 5% of the work.

After that we need:

  • Support the code and debug any features it brings it,
  • Have users manage servers where hugo server runs,
  • Bring the security of hugo server up to par,
  • Make the Hugo developer team responsible for very quick resolutions of security-critical bugs,
  • Add additional security code to prevent misuse of Hugo’s email feature,
  • Have users update and maintain their servers.

The whole point of using a 3rd party is that you don’t have to worry about stuff like this. :slight_smile:

(By the way, I definitely understand the privacy angle of maintaining your own data. And I agree with that. But 95% of people use free email services like GMail and Outlook, which already give those companies ‘read’ ability of those emails. Unfortunately. So maintaining your own secure email service is not going to solve data privacy, unfortunately.)

I think we have done well to show you that you have many options, so please don’t summarily discount the community’s advice.

Perhaps it’s best for you to do some more research on static site generators and how they work. SSGs like Hugo generate a series of static files…

I run a bunch of static sites and so built my own solution with a generous free plan that will work for like 99% of folks using static sites:

You can either use a UI to build a form, or just point your existing forms at a POST endpoint, dead easy. The API endpoint is also great if you want to submit entries with JavaScript and do something fancy on the client side.

Hope that helps. I’m a small provider but it is profitable and reliable, so I’ll be around for a while :slight_smile:

1 Like

Hey, You can check Getform out. We started to use recently and their UI is pretty good.

They offer 100 subs with Zapier integration on the free account and 5 forms with unlimited submission on the Basic paid plan.

Old thread, I know, but just wanted to complete the list and tell you guys about the service we are using

In my zen theme I have included a PHP script that can send mails on servers that support PHP.