Jump to content

php mail() from Dropdown or Checkbox Value


farnoise

Recommended Posts

Hi Everyone,

I'm making a form but this form doesnt have default destination email address. I need to send the information of the form to who that it blongs to

 

<input name="Support" type="checkbox" id="necho" value="suport@domain.com"/>
Customer Support
<input name="Sale" type="checkbox" id="etc" value="sale@domain.com">
Sale Dep.
              </div>

 

So when they check support form sends the support value that is its email address to my PHP proccessor as $support

if they check sale it'll send $sale value to my PHP and here is my PHP function

 

mail($support, $header, $message, "From: Client <automated-form@domain.com>");
mail($sale, $headerg, $message, "From: Client <automated-form@domain.com>");

 

 

Anyway! It's not working for some reason!!!!! :D Anybody can direct me??? PLZ

 

Thank u all

Link to comment
Share on other sites

I'd not include the actual email address within the form (for spam reasons) if I were you. Instead just set the check box value to true and check within your PHP code if they have checked sales/support and send accordingly. Without being able to see the bulk of the code, are you correctly setting the $support / $sales vars?

Link to comment
Share on other sites

mail($support, $header, $message, "From: Client <automated-form@domain.com>");

mail($sale, $headerg, $message, "From: Client <automated-form@domain.com>");

 

Could you show the code where these variables are declared? Also echo them out and check they are the values you're expecting.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.