i'm using matt's formmail script to process a form from my website...but i don't know how to make one of the fields appear in the subject of the email. can anyone help?
Hi Lisa
This works on our particular server - The name will probably be different but the syntax of most form mailing scripts appears similar.
Hope this is of use.
(after the qestion mark). POST carries this information invisibly.
GET becomes stored as $ENV{'QUERY_STRING'} or if you use POST then this is retrieved as:-
read(STDIN, $data, $ENV{'CONTENT_LENGTH'});
this data, in either situation, can be chopped up. All the data is stored as one long string of name/value pairs. This looks like surnname=Carr&forename=Duncan
This name/value pairs can first be split on the '&' then split finally into the name and value parts.
then you can make use of the data by storing all this information in variables, for example:-
[red]open (MAIL, '| /usr/sbin/sendmail -t');
[green]print MAIL "To: $data{email}\n";[/green]
print MAIL "Cc: \n";
print MAIL "Bcc: someone\@whateverisp.com\n";
print MAIL "From: webmaster\@my-mot.co.uk\n";
print MAIL "Subject: Thank you for using 'my-mot.co.uk'\n\n";
print MAIL "This is to confirm that your vehicle details for $data{reg} have been added to our M.O.T. database\n\n";
print MAIL "You will receive reminders 28 days, 7 days & 1 day prior to your M.O.T. test date of $data{due_day}/$data{due_month}\n\n";
print MAIL "Please tell your friends, family & colleagues about this new site!\n\n";
print MAIL "
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.