• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

Need Script or Technique to send Web Form data to different Email Addresses

Hi all - I need a Script or Technique to take Web Form data THEN execute 2 diff MailForm scripts (or 2 parts of the same script) depending on the Zip Code that a User enters into the Reply Form via a Browser.
RIght now, am using Linux/Apache web server and (forgive the big word) that ubiquitous MSA "Matts Script Archive" Form Script

I suppose I could either call 2 diff mail form scripts with some PHP code inside the HTML page ... or use some modified code onside the form script itself ...

Any suggestions?
2 Solutions
Amar BardoliwalaCommented:
Hello blegee,

According to me when form submits you can check for Zip Code and depending on Zip Code entered by User you can run mail script that you want.

Hope this will help you.

Thank You.


Here you go, pretty simple.
<!-- This is form.html -->

<form method=post action=zipcode.php>
Enter your zipcode:<input name=zipcode>
<input type=submit value=Submit>


Open in new window

// This is zipcode.php


if($zipcode) {
        switch($zipcode) {
                case "11111":   mail($rcpt1,$subject1,$body1,$from); break;;
                case "22222":   mail($rcpt2,$subject2,$body2,$from); break;;
                default:        echo "Unrecognized zip code<br>\n"; 
        echo "<a href=form.html>Back</a><br>\n";
} else {
        Header("Location: form.html");


Open in new window

bleggeeAuthor Commented:
Thank you, folks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now