in reply to Contact Form 2
Untested code using Mail::Sendmail to give you an idea why using a module is far better :)
#!/usr/bin/perl -wT use strict; use CGI; use Mail::Sendmail; my $q = new CGI; my $name = $q->param("name"); my $email = $q->param("email"); my $message = $q->param("message"); # Config my $adminmail = "admin\@yoursite.com"; my $from = "whoever\@whatever.com"; my $subject = "enter subject here"; # End config my %mail = ( To => "$adminmail", From => "$from", Subject => "$subject", Message => "$message" ); sendmail(%mail) or die $Mail::Sendmail::error; print $q->redirect("thanks.html") or die "Can't find thanks.html: $!\n +";
Update: You should include Juerd's improvements listed below.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Contact Form 2
by Juerd (Abbot) on Mar 25, 2002 at 10:12 UTC | |
by particle (Vicar) on Mar 25, 2002 at 13:19 UTC | |
|
Re: Re: Contact Form 2
by venimfrogtongue (Novice) on Mar 26, 2002 at 01:15 UTC |