J
J
JackShcherbakov2017-12-02 08:31:01
open server
JackShcherbakov, 2017-12-02 08:31:01

Why doesn't mail() work in PHP on openServer?

Here are the server settings i069.radikal.ru/1712/22/9fc54d143a56.jpg
Here is the code responsible for sending the email:

<?php
  $when_it_happened = $_POST['whenithappened'];
  $how_long = $_POST['howlong'];
  $name = $_POST['firstname']  . ' ' . $_POST['lastname'];
  $alien_description = $_POST['aliendescription'];
  $how_many = $_POST['howmany'];
  $fang_spotted = $_POST['fangspotted'];
  $email = $_POST['email'];
  $what_they_did = $_POST['whattheydid'];
  $to = '[email protected]'; //Многоточие в целях безопасности
  $subject = 'Aliens Abducted Me - Abduction Report';
  $msg = "$name was abducted $when_it_happened and was gone for $how_long.\n" .
    "Number of aliens: $how_many\n" .
    "Alien description: $alien_description\n" .
    "What they did: $what_they_did\n" .
    "Fang spotted: $fang_spotted\n" .
    "Other comments: $other";
  mail($to, $subject, $msg, 'From:' . $email);

  echo 'Thanks for submitting the form.<br />';
  echo '<h1>You were abducted ' . $when_it_happened . '</h1>';
  echo ' and were gone for ' . $how_long . '<br />';
  echo "Number of aliens:  $how_many <br />";
  echo 'Describe them: ' . $alien_description . '<br />';
  echo 'The aliens did this: ' . $what_they_did . '<br />';
  echo 'Was Fang there? ' . $fang_spotted . '<br />';
  echo 'Other comments: ' . $other . '<br />';
  echo 'Your email address is ' . $email . '<br />';
  echo 'Your Name is' . ' ' . $name;
?>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question