Jump to content

php mail() not working


breaking262

Recommended Posts

Hey guys, i'm quite new to php and my mail function wont work and i don't know why...

 

<?php
//if "email" variable is filled out, send email
  if (isset($_REQUEST['email']))  {
  
  //Email information
  $admin_email = "example@mail.com";
$name = $_REQUEST['email'];
  $email = $_REQUEST['email'];
  $date = $_REQUEST['date'];
$uur = $_REQUEST['uur'];
$behandeling = $_REQUEST['behandeling'];
$comment = $date ."\r\n";
  $comment .= $uur ."\r\n";
$comment .= $behandeling ."\r\n";
$comment .= $name;
 
 
  //send email
  mail($admin_email, "afspraak", $comment, "From:" . $email);
  
  //Email response
  echo "Bedankt voor uw afspraak!";
  }
  
  //if "email" variable is not filled out, display the form
  else  {
?>
 
 <form method="post">
  <input name="email" type="email" placeholder="email@adress.com" required/>
  <input type="text" name="name" placeholder="Voornaam Naam" required></input>
  <input type="text" name="date" placeholder="Datum: DD/MM/JJJJ" required></input>
<input type="text" name="uur" placeholder="jouw beschikbaarheid, bvb: '14:00 - 16:00'" required></input>
<input type="text" name="behandeling" placeholder="Behandeling, bvb: Pedicure en manicure" required></input>
<span>Vermeld de gewenste datum, het gewenste uur <br>en de behandeling a.u.b. <br>Hou na de e-mail je mailbox in de gaten voor een antwoord.</span><br><br>
  <input type="submit" class="myButton"  value="Verzend" />
  </form>
  
<?php
  }
?>
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.