in reply to write to a fax machine?

Might want to take a look at either Hylafax or mgetty+sendfax. I set up a simple form-to-fax gateway deelie-bobber a while back using perl, ghostscript, and sendfax. Ugly but worked. Basically took the form elements, wrote a formated text file, used ghostscript to turn that into a Group3 fax image, and sendfax to send it.

I think that in this case the best thing to do is to use perl as the wonderful glue language it is (among other things ;) to tie in external programs.

BTW, a quick search on http://freshmeat.net dug up Fax::Gate (interface to HylaFax) though I've never looked at it.