y7kim/agency-jekyll-theme

Mail server not responding

DirectGaming opened this issue · 1 comments

Hello, I am not too familiar with code and stuff but I have a website and a contact from, I used a template from bootstrap, I have added a few custom feilds such as drop downs and a tick bot to accept terms and conditions anyway, the problem is when I submit it, it says there is a error with my mail server. I will add my contact form code, and the contact_me.php found in the bin file. Hope someone can help.

`<?php
// check if fields passed are empty
if(empty($_POST['name']) ||
empty($_POST['phone']) ||
empty($_POST['email']) ||
empty($_POST['package'])
empty($_POST['message'])
empty($_POST['tandc']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
}

$name = $_POST['name'];
$phone = $_POST['phone'];
$package = $_POST['package'];
$message = $_POST['message'];
$tandc = $_POST['tandc'];

// create email body and send it
$to = 'thomas@directgaming.tv'; // PUT YOUR EMAIL ADDRESS HERE
$email_subject = "Request For: $name"; // EDIT THE EMAIL SUBJECT LINE HERE
$email_body = "You have received a new message from your website's contact form.\n\n"."Here are the details:\n\nName: $name\n\nPhone: $phone\n\nEmail: $email_address\n\nMessage:\n$message\n\ntandc\n\nPackage: $package\n";
$headers = "From: thomas@directgaming.tv\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
return true;
?>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="SimpltHost Request a server.">
<meta name="author" content="Thomas Wilson">
<link rel="icon" href="favicon.png">

<title>Request</title>

<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">

<!-- Custom CSS -->
<link href="css/modern-business.css" rel="stylesheet">

<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="index.html">Simply Host</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                 <li>
                    <a href="index.html">Home</a>
                </li>
                <li>
                    <a href="order.html">Order</a>
                </li>

                    </ul>
                </li>
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>

<!-- Page Content -->
<div class="container">

    <!-- Page Heading/Breadcrumbs -->
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">Request</h1>
            <ol class="breadcrumb">
                <li><a href="order.html">Order</a>
                </li>
                <li class="active">Request</li>
            </ol>
        </div>
    </div>
    <!-- /.row -->

    <!-- Content Row -->
    <div class="row">
        <!-- Contact Details Column -->
        <div class="col-md-4">
            <h3>Problem?</h3>
            <p>
                Do you have a problem? Please tell us.<br>
            </p>
            <p><i class="fa fa-envelope-o"></i> 
                <abbr title="Email">E</abbr>: <a href="mailto:support@simplyhost.tech">support@simplyhost.tech</a>
            </p>
            <p><i class="fa fa-clock-o"></i> 
                <abbr title="Hours">H</abbr>: Monday - Friday: 8:00AM - 7:00PM (GMT)</p>
                <p> Saturday: 9:00AM - 8:00PM (GMT)</p>
                <p> Sunday: <strong>Support is Closed</strong></p>
        </div>
    </div>
    <!-- /.row -->

    <!-- Contact Form -->
    <!-- In order to set the email address and subject line for the contact form go to the bin/contact_me.php file. -->
    <div class="row">
        <div class="col-md-8">
            <h3>Request a Package</h3>
            <form name="sentMessage" id="contactForm" novalidate>
                <div class="control-group form-group">
                    <div class="controls">
                        <label>Full Name:</label>
                        <input type="text" class="form-control" id="name" required data-validation-required-message="Please enter your name.">
                        <p class="help-block"></p>
                    </div>
                </div>
                <div class="control-group form-group">
                    <div class="controls">
                        <label>Phone Number:</label>
                        <input type="tel" class="form-control" id="phone" required data-validation-required-message="Please enter your phone number.">
                    </div>
                </div>
                <div class="control-group form-group">
                    <div class="controls">
                        <label>Email Address:</label>
                        <input type="email" class="form-control" id="email" required data-validation-required-message="Please enter your email address.">
                </div>  
                    </div>
                <div class="control-group form-group">
                    <div class="controls">
                        <div class="form-group">
                            <label for="sel1">Package</label>
                            <select class="form-control" id="sel1" required data-validation-required-message="Please select a package.">>
                            <option>Teamspeak: Bronze</option>
                            <option>Teamspeak: Silver</option>
                            <option>Teamspeak: Gold</option>
                            <option>Minecraft: Bronze</option>
                            <option>Minecraft: Silver</option>
                            <option>Minecraft: Gold</option>
                            <option>Web Hosting: Dirt</option>
                            <option>Web Hosting: Bronze</option>
                            <option>Web Hosting: Silver</option>
                            <option>Web Hosting: Gold</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="control-group form-group">
                    <div class="controls">
                        <label>Address:</label>
                        <textarea rows="10" cols="100" class="form-control" id="message" required data-validation-required-message="Please enter your address" maxlength="999" style="resize:none"></textarea>
                    </div>
                </div>
                <div class="control-group form-group">
                    <div class="controls">
                    <label class="checkbox-inline"><input type="checkbox" id="tandc" required data-validation-required-message="You need to accept the terms and conditions">I accept the <a href="termsandconditions.html">terms and conditions</a></label>
                <br>
                <br>


                <div id="success"></div>
                <!-- For success/fail messages -->
                <button type="submit" class="btn btn-primary">Request</button>
            </form>
        </div>

    </div>
    <!-- /.row -->

    <hr>

    <!-- Footer -->
    <footer>
        <div class="row">
            <div class="col-lg-12">
                <p>Copyright &copy; Simply Host 2016</p>
                <p>Site Version: 0.4</p>
            </div>
        </div>
    </footer>

</div>
<!-- /.container -->

<!-- jQuery -->
<script src="js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>

<!-- Contact Form JavaScript -->
<!-- Do not edit these files! In order to set the email address and subject line for the contact form go to the bin/contact_me.php file. -->
<script src="js/jqBootstrapValidation.js"></script>
<script src="js/contact_me.js"></script>
`
y7kim commented

please see this thread:

#14