Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


PHP Contact form not working the right way

Posted on 2011-10-06
Medium Priority
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: julie@targetgroupmedia.com 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        = "julie@targetgroupmedia.com";
$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

Derokorian earned 1000 total points
ID: 36925114
$sendTo        = "julie@targetgroupmedia.com";
$sendTo        = "Carlyle on the Green <julie@targetgroupmedia.com>";

LVL 13

Assisted Solution

haloexpertsexchange earned 1000 total points
ID: 36925138
did you try doing the $sendTo like this "Carlyle on the Green <julie@targetgroupmedia.com>"?
LVL 31

Expert Comment

by:Marco Gasi
ID: 36925167
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
"julie@targetgroupmedia.com" 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

ID: 36925402
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

ID: 36925558
THANKS Derokorian AND haloexpertsexchange  you guys solved it..

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

581 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