title: RASPBERRY PI WEBSERVER PHP MAIL PROBLEMS
body: <p>Welcome to my first stackoverflow question :/</p>
  <p>Today I bought myself my first domain on strato.de.
  I created on my raspberrypi a webserver to host my website, added my domain to it - so i can connect to my webserver over my domain.</p>
  <p>My website got a contact form which takes data and a message and sends a mail to my email.
  <br>
  I installed php on my raspberry but I dont know why the form does not work.
  The emails are never arriving.</p>
  <p><strong>MY HTML FILE:</strong></p>
  <pre><code>&lt;form action=&quot;./mail_handler.php&quot; method=&quot;POST&quot;&gt;
                          &lt;div class=&quot;p pb-3&quot;&gt;&lt;strong&gt;Feel free to contact me &lt;/strong&gt;&lt;/div&gt;
                          &lt;div class=&quot;row mb-3&quot;&gt;
                            &lt;div class=&quot;col&quot;&gt;
                              &lt;div class=&quot;input-group&quot;&gt;&lt;span class=&quot;input-group-addon&quot;&gt;&lt;i
                                    class=&quot;fa fa-user-circle&quot;&gt;&lt;/i&gt;&lt;/span&gt;
                                &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;first_name&quot; id=&quot;first_name&quot;
                                  placeholder=&quot;Firstname&quot; required=&quot;required&quot; /&gt;
                              &lt;/div&gt;
                            &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class=&quot;row mb-3&quot;&gt;
                            &lt;div class=&quot;col&quot;&gt;
                              &lt;div class=&quot;input-group&quot;&gt;&lt;span class=&quot;input-group-addon&quot;&gt;&lt;i
                                    class=&quot;fa fa-user-circle&quot;&gt;&lt;/i&gt;&lt;/span&gt;
                                &lt;input class=&quot;form-control&quot; type=&quot;text&quot; name=&quot;last_name&quot; id=&quot;last_name&quot;
                                  placeholder=&quot;Lastname&quot; required=&quot;required&quot; /&gt;
                              &lt;/div&gt;
                            &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class=&quot;row mb-3&quot;&gt;
                            &lt;div class=&quot;col&quot;&gt;
                              &lt;div class=&quot;input-group&quot;&gt;&lt;span class=&quot;input-group-addon&quot;&gt;&lt;i
                                    class=&quot;fa fa-envelope&quot;&gt;&lt;/i&gt;&lt;/span&gt;
                                &lt;input class=&quot;form-control&quot; type=&quot;email&quot; name=&quot;email&quot; id=&quot;email&quot; placeholder=&quot;E-mail&quot;
                                  required=&quot;required&quot; /&gt;
                              &lt;/div&gt;
                            &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class=&quot;row mb-3&quot;&gt;
                            &lt;div class=&quot;col&quot;&gt;
                              &lt;div class=&quot;form-group&quot;&gt;
                                &lt;textarea class=&quot;form-control&quot; name=&quot;message&quot; placeholder=&quot;Your Message&quot;
                                  required=&quot;required&quot;&gt;&lt;/textarea&gt;
                              &lt;/div&gt;
                            &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class=&quot;row&quot;&gt;
                            &lt;div class=&quot;col&quot;&gt;
                              &lt;button class=&quot;btn btn-primary&quot; type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Send&quot;&gt;Send&lt;/button&gt;
                            &lt;/div&gt;
                          &lt;/div&gt;
                        &lt;/form&gt;
  </code></pre>
  <p><strong>MY PHP FILE</strong></p>
  <pre><code>&lt;?php if(isset($_POST['submit'])){
  $to = &quot;contact@mymail.de&quot;; // Empfägner Adresse
  $from = $_POST['email']; // Absender Adresse
  $first_name = $_POST['first_name'];
  $last_name = $_POST['last_name'];
  // $phone = $_POST['phone'];
  $subject = &quot;PORTFOLIO&quot;;
  
  $message = $first_name . &quot; &quot; . $last_name . &quot;\n&quot; . $from .  &quot; schrieb folgendes:&quot; . &quot;\n\n&quot; . $_POST['message'];
  
  $headers = &quot;From:&quot; . $from;
  $headers2 = &quot;From:&quot; . $to;
  mail($to,$subject,$message,$headers);
  header('Location: ./contact_success.html');
  }?&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/2USkY.jpg" rel="nofollow noreferrer">phpinfo()</a></p>
  <p>I tried so much I dont know what I can do, maybe someone can help me.
  If you need more infos just hit me up</p>