Forum Moderators: coopster & phranque

Message Too Old, No Replies

Send form data to different email addresses depending on a value?

         

2004mark

2:25 pm on Jun 24, 2005 (gmt 0)

10+ Year Member



Hello everyone.

I've got a problem, hopefully somebody here will be able to point me in the right direction.

I'm currently sending the data collected from a form on a website to 10 different email addresses, using FormMail.pl.

Ideally though I would like to send the data only to the appropriate email address. This will be determined by the first half of the 'post code' input value of the form.

Can this be done by modifying the perl script that I am using at the moment, or am I barking up the wrong tree and should be pursuing a different method?

prophead

11:39 pm on Jun 24, 2005 (gmt 0)

10+ Year Member



find the line that opens your email program and change it to this after you populate the variables found it:

if ($condition eq $your_condition) {
open (MAIL, "¦$mailprog $email1") ¦¦
die("Can't open $mailprog\n");
} else
open (MAIL, "¦$mailprog $email2") ¦¦
die("Can't open $mailprog\n");
} # end if condition

¦-<:)