Please help me with sendmail!

by 1 replies
2











#programming #sendmail
  • Hi Cruiser,

    The problem (I believe) lies in your sendmail.php file.

    I would suggest the following code to replace your sendmail.php file :


    <?php
    $to_email = "me@mywebsite.com";
    $redirectto = "http://www.redirecthere.com";

    if (isset($_POST['Send']))
    {
    $name = strip_tags(trim(stripslashes($_POST["Name"])));
    $email = strip_tags(trim(stripslashes($_POST["E-mail"])));
    $title = "Feedback Form Results";

    $msg = "A new user has just signed up. Their details are as follows:
    Name : $name
    Email : $email";

    $headers = "From: $name <$email>\r\n" .
    "Reply-To: $name <$email>\r\n" .
    "X-Mailer: PHP/" . phpversion();

    mail($to_email, $title, $msg, $headers);
    header('Location: '.$redirectto);
    exit;
    }

    ?>


    I think this should do the job for you

    Hope this helps

    Bruce

Next Topics on Trending Feed

  • 2

    Hi all I hope you can help me. I set up a simple form on my website, only fields for name and e-mail and a send button. I am using Joomla, and I added the folowing code in the source field of an article. (Should it be here or somewhere else?)