i have a site the is live being testes but it wont let mail be sent and i have changed it to mail.companyname.com like i was told but still nothing and the sever said i need 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. This is got me lost as i am new to this and just trying to finish. PLEASE HELP

7 Years
Discussion Span
Last Post by cwarn23

Well first I will have to ask are you on a shared server or dedicated server or vps (virtual private server). If your on a shared server then it should be your hosts responsibility to fix up the mail server as it requires modifying the php.ini and only the master administrator (the hosting company if a shared server) of the server can do that. But just before you contact anyone, make sure your emails didn't go into the spam box. That can sometimes be a big problem.
If however you have a virtual private server or dedicated server then chances of any person new to mail servers have very little chance of fixing it.
So please post an example script and let us know if your on a shared host because with shared hosting the support team may be responsible for this one.


how can i show you that as i am new to this, i will copy and paste what you need


how can i show you that as i am new to this, i will copy and paste what you need

Yea, just copy and past the code/page which contains the mail() function into the reply box but be sure to use code tags. Then I will check the code for anything that may stop the mail function from working and let you know if it is just a change in the code or something that your host needs to configure on the server.


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

$ToEmail = "thirdstr@thirdstreetdesignstudio.com";
$ToName = "Recipient";
$ToSubject = "Email Sent";


//--------------------------------------------------------------------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'];

    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, $headers);

echo "_root.Status=success";


Edited by Reverend Jim: Fixed formatting


As messy as that code may be it appears to still be valid if the url has ?_emailx=something or if there is a '_emailx' field in the html form. Try the following example and if it works then I will help you clean up the code.

$to      = 'nobody@example.com';
//put a working email above for you to receive the message
$subject = 'the subject';
$message = 'hello';
//change yoursite.com to your domain name below
$headers = 'From: user@yoursite.com' . "\r\n";
mail($to, $subject, $message, $headers);

If the above doesn't work and have made the 2 changes to the code then I would suggest contacting your web host for allowing php to send email. If however the above code i've posted does work then post the html form associated with the above code and I shall clean it up for you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.