How do I add session variables to the Subject field and the Message body of the email?
How do I add session variables to the Subject field and the Message body of the email? Tried many combinations, but do not seem to get the syntax right.
This is the code I have. I need to change all those form variables in $msg into session variables. The $to part is taken care of. What remains are the $subject field and the $msg field.
$to='To: ' . $_SESSION['toemail'];
$subject="$firstname $lastname, Your Registration Details";
$from="From: mail@xyz.com";
$msg="Dear $title $firstname $lastname\r\n\nThank you for registering for the design of your Dream Home.\r\nWe have received the following details from you-\r\n\nClient Details-\r\n\nOccupation: $occupation \r\nPhone No: $phone \r\nE-mail: $email\r\n\nPresent Location:\r\n$location\r\n\nPresent Address:\r\n$address\r\n\n\nFollowing are the Design Requirements specified by you-\r\n\nBasic Features\r\n\nNo. of Floors: $floors\r\nNo. of Bedrooms: $bedrooms\r\nNo. of Bathrooms: $bathrooms\r\nFloor Area: $sqft\r\n\nFurther Suggestions: $further\r\n\n\nType of Floor Plan\r\n\nSplit Floor: $splitfloor\r\n- Remarks: $splitfloorremarks\r\nOpen Floor: $openfloor\r\n- Remarks: $openfloorremarks\r\n\n\nList of Rooms to be Included\r\n\nFoyer: $foyer\r\n- Remarks: $foyerremarks\r\nDrawing: $drawing\r\n- Remarks: $drawingremarks\r\nFormal Living: $formalliving\r\n- Remarks: $formallivingremarks\r\nFamily Living: $familyliving\r\n- Remarks: $familylivingremarks\r\nHome Office: $homeoffice\r\n- Remarks: $homeofficeremarks\r\nDining: $dining\r\n- Remarks: $diningremarks\r\nMaster Bedroom: $master\r\n- Remarks: $masterremarks\r\nMaster Bathroom: $masterbath\r\n- Remarks: $masterbathremarks\r\nMaster Dressing: $masterdress\r\n- Remarks: $masterdressremarks\r\nBedroom: $bed\r\n- Remarks: $bedremarks\r\nBathroom: $bath\r\n- Remarks: $bathremarks\r\nDress: $dress\r\n- Remarks: $dressremarks\r\nStudy: $study\r\n- Remarks: $studyremarks\r\nLibrary: $library\r\n- Remarks: $libraryremarks\r\nPowder Room: $powder\r\n- Remarks: $powderremarks\r\nPrayer Room: $prayer\r\n- Remarks: $prayerremarks\r\nKitchen: $kitchen\r\n- Remarks: $kitchenremarks\r\nPantry: $pantry\r\n- Remarks: $pantryremarks\r\nUtility/Work Area: $utility\r\n- Remarks: $utilityremarks\r\nBalcony: $balcony\r\n- Remarks: $balconyremarks\r\nStore: $store\r\n- Remarks: $storeremarks\r\nLaundry: $laundry\r\n- Remarks: $laundryremarks\r\nVeranda: $veranda\r\n- Remarks: $verandaremarks\r\nCar Porch: $carporch\r\n- Remarks: $carporchremarks\r\nGarage: $garage\r\n- Remarks: $garageremarks\r\nHome Theater: $theater\r\n- Remarks: $theaterremarks\r\nMaid's Room: $maid\r\n- Remarks: $maidremarks\r\n\nOther General Remarks: $general\r\n\nPlease note that the fields that were left blank in your form will be considered as undecided details and used in the Architect's discretion.\r\nIf you wish to add any more Design requirements later, please feel free to reply to this email with details.";
$fla=mail($to,$subject,$msg,$from);
Thanks in advance!
