Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Member dsmflash's Avatar
    Join Date
    Jan 2007
    Location
    Indiana
    Posts
    40
    Member #
    14695
    Hello,
    I have made a mail form in Flash and when I submit the info, I get the email but the phone number and everything is in the "from" field in the email. I want the phone number to go in the message area in the receipients mail. Here is my code:
    <?php

    $sendTo = "joeblow@yahoo.com";
    $subject = "A message from joeblow.com";
    $headers = "From: " . $_POST["name"] ." " . $_POST["phone"] ."<" . $_POST["email"] .">\r\n";
    $headers .= "Reply-To: " . $_POST["email"] . "\r\n";
    $headers .= "Return-path: " . $_POST["email"];
    $message = $_POST["message"];
    mail($sendTo, $subject, $message, $headers);
    ?>

    If anyone can help me with the correct code or suggest a better method, please let me know. I really appreciate it!

  2.  

  3. #2
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,656
    Member #
    1234
    Liked
    137 times
    it's pretty obvious why the phone number is in the from, because that's where you put it!

    Just concatenate it to the message var instead of the headers var and you'll be fine.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  4. #3
    Member blue_francis14's Avatar
    Join Date
    May 2007
    Location
    Philippines
    Posts
    83
    Member #
    15276
    Wired, right. Try this instead...
    PHP Code:
     <?php

    $sendTo 
    "joeblow@yahoo.com";
    $subject "A message from joeblow.com";
    $headers "From: " .$_POST["name"]." <"$_POST["email"].">\r\n";
    $headers .= "Reply-To: " $_POST["email"] . "\r\n";
    $headers .= "Return-path: " $_POST["email"];

    $message .= $_POST["phone"]."\r\n";
    $message .= $_POST["message"];

    mail($sendTo$subject$message$headers);
    ?>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:54 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com