Hey I have a website and the administration panel is powered by cPanel.
I cant seem to find out why i cant send mail when using the site
I have squirrel mail installed and I have a cPanel password changer plug-in installed for squirrel mail., . here is the codeing can some tell me what im doing wrong

<?php


//--------------------------------------------------------------------User Area

$ToEmail = "mail.thirdstreetdesignstudio.com";
$ToName = "Dallas Thompson";
$ToSubject = "Thanks for your email. One of our consultants will respond to your request shortly. ";

//--------------------------------------------------------------------





//--------------------------------------------------------------------Prohibited Area No Changes 
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '.$_POST['_namex'].' <'.$_POST['_emailx'].'>' . "\r\n";

$Message = "Sender Name:".$_POST['_namex']."<br/><br/>Sender Email:".$_POST['_emailx']."<br/><br/>Sender Phone:".$_POST['_phonex']."<br/><br/>Message:".$_POST['_commx'];

if($_REQUEST['_emailx']!=""){
    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, $headers);
}


echo "_root.Status=success";


?>

the server company told my i needed to have this yes, you will need to put the full email address in order to make it work and provide for the authentication also in the coding which needs the password stored somewhere and the actual server authentication addressed as well.

can someone please help im so lost

I'd suggest a more simplified test:

<?php

error_reporting(E_ALL);
ini_set('display_errors', '1');

mail("myemail@example.com", "test email", "test was a success", "from:myemail@example.com");

?>

Replace myemail@example.com with your real email. If you get an email, the it is working properly.

If you get some errors or don't get an email, then you know something is wrong.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.