Forum Moderators: coopster

Message Too Old, No Replies

One form - two email accounts

         

macmuso

8:31 am on Feb 9, 2003 (gmt 0)

10+ Year Member



I want to have a contact page on my website, and have the visitors be able to email me through a form. However I wish to separate the emails regarding the site and the emails regarding the business. Can I have a single form to do this? Or do I have to make two separate forms with two submit buttons?

brotherhood of LAN

8:51 am on Feb 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi macmuso,

You could do it a few ways. The first that comes to mind is adding another form field, something like "what is the nature of the enquiry", and have an option for "site" and one for "business".

<select size="1" name="emailtype">
<option value="1">Site</option>
<option value="2">Business</option>
</select>

then when the form is submitted

if($HTTP_POST_VARS['emailtype'] == 1)
{
// Site Email / Do whatever here
}
else
{
// Business Email Do whatever here
}

You could maybe change the title of the email you send so that you can still tell the difference when you get the mail ;)