You have three errors (and one bonus mistake):
You put the body of the message in a variable called
$message
but use a variable called$text
in yourmail()
function.You use the wrong variable for your headers. You use
$email
it should be$headers
Plus it appears you have the variables in your
mail()
function out of order. Headers go after message body.You write a variable called
$formcontent
but never use it. It is redundant with$message
anyway.
$send_contact=mail($to,$subject,$message,$headers);