How to add a pure HTML subscribe email box and sub button to my site

How do I add a simple HTML form, with only an email address input and a send button, to my own website? I’d like to stay on my site after submission. I’m not sure how confirmation – “your address has been submitted” – might be handled, I’d be happy with even a redirect to another page on my site.

I’ve read a bunch of things on this, here and elsewhere, but they’re mostly years old, and none are absolutely clear. I saw the AJAX form info in the phpList manual, but would like not to have to use Google.

Is this a difficult problem, or is there a simple solution with example code?

I’m self-hosting phpList.


You will need to enable the API, which is documented in the manual (and on plenty of sites). You should make sure that you are using php version 8.0 or lower, as the API currently has an incompatibility with 8.1 or higher.

This site gives useful examples for each of the calls. One thing to note, is you can add subscribers this way but they will not be attached to a list.

Are you using Wordpress for your site? If so, I will be releasing a plugin to do this in fairly short order.