PHP Contact form not working the right way

Posted on 2011-10-06
Last Modified: 2012-06-22
i cant figure out why my elite contact form is not working the right way.. the issue is that i want the $to_name to be Carlyle on the Green, and I have done a quick test and the form says To: when it supposed to say To:Carlyle on the Green.. bellow is the php code.. any help would be apprecated..

 PLEASE dont help me if you are going to complain about a score you will get or how much you will be awarded after you aswer.. Who ever answers always gets an A..

thanks for your KIND help

$sendTo        = "";
$subject = "Carlyle On The Green Email Submission Form";
$to_name       = "Carlyle on the Green";
$lastname = $_GET['lastname'];
$email = $_GET['email'];
$name = $_GET['name'];
$weddings = $_GET['weddings'];
$socialevents = $_GET['socialevent'];
$corporateevents = $_GET['corporateevent'];
$holidayevents = $_GET['holidayevent'];
$taste99 = $_GET['taste99'];
$alltheabove = $_GET['alltheabove'];

// send mail
$headers  = "From: $email\r\n";
// $headers .= 'MIME-Version: 1.0' . "\r\n";
// $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$msg = "Carlyle on the Green Mailing List Submission :\n\nName:".$name." \n\nLast Name:".$lastname." \n\nE-mail:".$email."\n\nWeddings:".$weddings." \n\nSocial Events:".$socialevent." \n\nCorporate Events:".$corporateevent." \n\nHoliday Events:".$holidayevent." \n\nTaste 99:".$taste99." \n\nAll The Above:".$alltheabove."";
mail($sendTo, $subject, $msg, $headers);

echo "status=formOk";
Question by:julianne26
    LVL 10

    Accepted Solution

    $sendTo        = "";
    $sendTo        = "Carlyle on the Green <>";

    LVL 13

    Assisted Solution

    did you try doing the $sendTo like this "Carlyle on the Green <>"?
    LVL 30

    Expert Comment

    by:Marco Gasi
    Sorry, but what form you're talking about? I can't see any form in your code: how you fill the form? I only see that $sendTo is set to
    "" and that in mail() mfunction you use $sendTo and $to_name varuable is never used in code you posted here... Maybe you need to post some more code... or I'm stupid

    Author Comment

    this is an old code form someone else.. thats why it might be a little off.. thats all the code.. if i need to add something else to the code to make it work then let me know.. i know as much as you know at this point and no your not stupid..

    Author Comment

    THANKS Derokorian AND haloexpertsexchange  you guys solved it..

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    As this topic comes over and over again in different forms, I've finally decided to write a short (yea, right...) article / tutorial about pagination with PHP with MySQL database. There are dozens of these kind of tutorials, I know - I wanted to mak…
    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now