[wplug] html form to email cgi advice

Duncan Hutty dhutty at allgoodbits.org
Tue Feb 14 15:41:43 EST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2/13/12 11:08 AM, Gabriel L. Somlo wrote:
> Hi,
> 
> I'm trying to set up a couple of html forms that would generate
> emails when submitted. Ability to "attach" files (via html
> type="file" input) would be a huge plus.
> 
> So far I found FormMail on www.scriptarchive.com/formmail.html,
> 
> and also something that many claim to be a better solution,
> 
> NMS tfmail at http://nms-cgi.sourceforge.net/scripts.shtml
> 
> The latter claims to support html uploads, but I haven't had a
> chance to try it out yet.
> 
> I'm curious if anyone knows of any other solutions, preferably 
> something that already has a package in Fedora/EPEL ?

Hi Gabriel,

If I were solving this, I would probably use one of the many modern
micro web frameworks such as Dancer (perl), Flask (python) or
Sinatra(ruby).

They all have built-in webservers for development and are trivially
easy to run under one of their language's application servers when you
move to production. (Perl -> Starman or anything PSGI, Python ->
Gunicorn/Tornado or anything WSGI, Ruby -> Mongrel/Passenger or
anything rack compatible)

If you're still remember your perl, Dancer (cpanm Task::Dancer) is
very straightforward to do simple form processing.
Dancer::Plugins::Email will generate mail for you, or you could use
your favourite modules from CPAN. The pod on CPAN, and other docs at
perldancer.org and advent.perldancer.org should be more than
sufficient to get a simple project off the ground and viable in a day
or two.

I've also done this sort of thing in python with Flask.

The long and the short is that it has become incredibly easy to put up
simple (and sometimes not so simple) websites/webapps in the last few
years. PHP, Java, LISP, Erlang, Haskell and C all have micro
webframeworks, so pick your poison.
- -- 
Duncan Hutty
http://www.allgoodbits.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk86xwcACgkQCFuTFybf1wqqWQCfZGY+U9b8ej1cR+x1ADBfAAIa
psMAnRa/dUdHl1o+0S06U1DI52FxwkSa
=qZvz
-----END PGP SIGNATURE-----


More information about the wplug mailing list