SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Email PHP . Unknown Sender

    Hi ,

    I need help to solve this problem

    screenshot.jpg

    This is the PHP coding

    <?php
    if((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")){

    $email_from = $_POST['email']; // Who the email is from
    $email_subject = "New Reservation"; // The Subject of the email

    $email_txt="Name: ".$_POST['name']."<br>";
    $email_txt.="Contact: ".$_POST['contact']."<br>";
    $email_txt.="Email: ".$_POST['email']."<br><br>";

    $email_txt.="Premises: ".$_POST['premises']."<br>";
    $email_txt.="Bedroom Type: ".$_POST['bedrooms']."<br>";
    $email_txt.="No Of Pax: ".$_POST['pax']."<br>";
    $email_txt.="Check in date: ".$_POST['indate']."<br>";
    $email_txt.="Check out Date: ".$_POST['outdate']."<br><br>";

    $email_txt.="Enquiry: ".$_POST['enquiry']."<br>";

    $email_to = "retribution_2005@hotmail.com"; // Who the email is too

    $headers = "From:".$email_from;

    $semi_rand = md5(time());
    $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

    $headers .= "\nMIME-Version: 1.0\n" .
    "Content-Type: multipart/mixed;\n" .
    " boundary=\"{$mime_boundary}\"";

    $email_message = "This is a multi-part message in MIME format.\n\n" .
    "--{$mime_boundary}\n" .
    "Content-Type:text/html; charset=utf-8\n" .
    "Content-Transfer-Encoding: 7bit\n\n" .
    $email_txt . "\n\n";

    $ok = @mail($email_to, $email_subject, $email_message, $headers);

    header( 'Location: reservation.php?status=ok' ) ;

    }
    ?>

  2. #2
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    The From: header has to be the email address the mail() is sending the email from, not the email address of the person who filled out the form.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •