0

First: This is NO ADVERT FOR byet.host (a website). Second: I'm a bit of a noob when it comes to databases, mysql, etc.

Ok, so I've got a site with a contact form. When I run it in my XAMPP server, it works fine (I receive a mail with the info they typed in the form). But when I run it in my byet.host server, I don't receive a e-mail. Do I need to set up a database, or do anything else?

        <?php

        $n = $_POST['n'];
        $e = $_POST['e'];
        $m = $_POST['m'];
        $to = "**@gmail.com";
        $subject = "** message";
        $headers = 'From: **@gmail.com';
        $message = '
        Client name: '.$n.'
        Client e-mail: '.$e.'
        Client message: '.$m.'


Contact and website hosting is done by **.
';

   if (
    mail($to, $subject, $message, $headers)
) 
      echo"<script>alert('Your message has been send succesfully!')</script>";
   else
      echo"<script>alert('ERROR. Please contact us on Instagram. Message not send.')</script>";
  ?>
  • Check the outbound connection is block by hosting company. Contact the administrator – Tamil Selvan C Mar 17 '17 at 13:46
  • Where do I check that? In email? –  Mar 17 '17 at 13:47
  • *"I'm a bit of a noob when it comes to databases, mysql, etc"* - what does this have to do with what you posted? – Funk Forty Niner Mar 17 '17 at 13:47
  • In cpanel or hosting providing tools – Tamil Selvan C Mar 17 '17 at 13:47
  • *"Do I need to set up a database"* - no. You need to make sure that mail is made available to you. Does "Your message has been send succesfully!" pop up when the script fires? If it shows you the `else` then you need to check for errors and your logs. You should also use proper bracing techniques. `If(...){...} else{...}`. – Funk Forty Niner Mar 17 '17 at 13:49
  • and what about the HTML form for this? we don't know if that failed or not. – Funk Forty Niner Mar 17 '17 at 13:50
  • Ok, I looked at outbound, and it is blocked (on the free service). I think there is no way around this. Thanks for the help! –  Mar 17 '17 at 13:56

0 Answers0