php - Send mail functionality to submit through form not working -


i not sure issue, when submitting form wont send email. below code:

if (isset ($_post['business_name']) && isset ($_post['business_address']) && isset ($_post['business_city']) && isset ($_post['business_email'])) {  $business_name = $_post['business_name']; $business_address = $_post['business_address']; $business_city = $_post['business_city']; $business_email = $_post['business_email'];  if (!empty($business_name) && !empty($business_address) &&!empty($business_city) && !empty($business_email))  {  $to = 'myemail@gmail.com';  $subject = 'new submission mywebsite.com'; $body = $business_name. "\n" . $business_address. "\n" . $business_city .          "\n" . $business_email; $headers = "from:" . $business_email;      if (@mail ($to, $subject, $body, $headers))               }          }       ///i think there wrong im beginner           <form action="emailtest.php" method="post"> <input id="busines_name" type="text" placeholder="business name" required>   <br /> <input id="business_address" type="text" placeholder="business address"   required><br /> <input id="business_city" type="text" placeholder="business city & state" required><br /> <input id="business_email" type="email" placeholder="your email address" required><br /> <input type="submit"value="submit"> </form> 

change input fields

<input id="busines_name" name="busines_name" type="text" placeholder="business name" required>   <br /> 

you need use name option make work


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -