-1

So i want my people to be able to contact me VIA my upcoming community website. and it's pretty tough, cus the sendemail.php won't send the emails to my Email. so if i published it right now, i would never know if they had a problem.

So i need some help, fixing it. ive browsed for a bit, and it's getting late, im hoping to wake up to a fix tomorrow =)

Here is my HTML: ..

                <form class="form-horizontal" name="contact_form" id="post" method="post" action="sendemail.php">
                    <div class="modal-header">
                        <h4>Contact One Two Seven Three</h4>
                    </div>
                    <div class="modal-body">

                        <div class="form-group">

                            <label for="contact-name" method="post" class="col-lg-2 control-label">Name:</label>
                            <div class="col-lg-10">

                                <input type="text" class="form-control" name="fullname" id="contact-name" placeholder="Dit Fulde Navn">

                            </div>

                        </div>

                        <div class="form-group">

                            <label for="contact-email" class="col-lg-2 control-label">Email:</label>
                            <div class="col-lg-10">

                                <input type="email" class="form-control" name="email" id="contact-email" placeholder="Din personlige Email / Betalende Email">

                            </div>

                        </div>

                        <div class="form-group">

                            <label for="contact-steamid" class="col-lg-2 control-label">SteamID:</label>
                            <div class="col-lg-10">

                                <input type="text" class="form-control" name="steamid" "id="contact-steamid" placeholder="Dit Steam ID">

                            </div>

                        </div>

                        <div class="form-group">

                            <label for="contact-msg" name="message" class="col-lg-2 control-label">Besked:</label>
                            <div class="col-lg-10">

                                <textarea class="form-control" name="message" rows="8"></textarea>

                            </div>

                        </div>

                    </div>
                    <div class="modal-footer">
                        <a class="btn btn-default" data-dismiss="modal">Luk</a>
                        <button class="btn btn-primary" id="submit" name="submit" type="submit" value="submit">Send Email</button>
                    </div>
                </form>

Here is my PHP: ..

<?php 
$fullname = $_POST['fullname'];
$email = $_POST['email'];
$message = $_POST['message'];
$steamid = $_POST['steamid'];
$formcontent="From: $fullname \n SteamID: $steamid \n Message: $message";
$to = "// Removed my Email (EDIT)";
$subject = "Ny Besked Fra OTST Kontakt Form";
$mailheader = "From: $email \r\n";
mail($to, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>

// Edit: Removed my Email

Fraklo
  • 11
  • 2
  • are you working from a live server that has `mail()` turned on/working? Have you narrowed down where your issue is? – Sean Dec 13 '15 at 23:08

1 Answers1

0

I've only ever had headaches with sendmail(). In any critical implementations, I'd suggest looking into a delivery infrastructure such as Sendgrid or Mandrill.

Most of them have an existing library for your chosen language so it's plug-and-play with their API. (I'd go with Sendgrid and, in this case, their PHP library)