Email server with php

Hi guys,

I’m trying to send email to clients with this php script using my hostmonster server.
But it doesn’t send the email and it shows no errors so I don’t know what the problem is. I’m guessing it has to do with the SMTP that has to be authenticated but I have no idea how to do that (tried to for 5 hours now).

If the solution is too complicated, could you guide me on any other way I can send emails to clients using php (maybe without SMTP)?


if ($_POST['submit'])
    //get data from form
    $name = $_POST['name'];
    $message = $_POST['message'];
    if ($name&&$message)
       if (strlen($name)<=$namelen&&strlen($message)<=$messagelen)
           //everything is ok
           //set smpt in php.ini
           ini_set("SMTP", "");

            //setup variables
            $to = "";
            $subject = "email from adam";
            $headers = "From:";
            $body = "This is an email from $name\

            mail($to, $subject, $body, $headers);

            die("Max length for name is $namelen and max length for message is $messagelen");

           die("you must enter name and message");



<form action='sendmeanemail.php' method='POST'>
Name:<input type='text' name='name'><br>
Message<textarea name='message'></textarea><p>
<input type='submit' name='submit' value='Send me this'>