#!/usr/local/bin/perl -Tw use strict; use URI::URL; use LWP::UserAgent; foreach (@ARGV) { FormMail($_); } sub FormMail { my ($url) = @_; return unless ( defined $url ); $url =~ m@http://([^/:]+)@; my $host = $1; die "No host in URL?!?!:$!" unless ( defined $host ); my (%form) = ( 'recipient' => 'listme@dsbl.org', 'subject' => "I'm an open formmail.pl server!", 'email' => 'postmaster@' . $host, 'comments' => q&DSBL Message I don't remember what the format is. And they don't seem to be giving out the "cookies" yet. Very sad. I'd like a cookie. Chocolate chip please. DSBL END & ); my $ua = new LWP::UserAgent; #$ua->proxy(http => 'http://proxy:port'); my $req = new HTTP::Request 'POST', $url; $req->content_type('application/x-www-form-urlencoded'); my $curl = url("http:"); # create an empty HTTP URL object $curl->query_form(%form); $req->content( $curl->equery ); # %form content as escaped query string $ua->request($req); }