Oki this has really bemused me, so any help would be very much appreciated...
It is a forgot password form, which is meant to send the user their password via e-mail. I'm in a puzzle as to whether it is down to the Hosting Company as all the Form Mail scripts are not working all bringing up the same error message.
The error message is as follows:
Warning: mail(): SMTP server response: 501 Syntax error in parameters or arguments in #### on line 40
The code:
[COLOR=Navy]
if(isset($_POST[u2]))
{
$q1 = "select * from re2_agents where username = '$_POST[u2]' ";
$r1 = mysql_query($q1) or die(mysql_error());
if(mysql_num_rows($r1) == '1')
{
//ok
$a1 = mysql_fetch_array($r1);
$to = $a1[email];
$subject = "Your password";
$message = "Hello $a1[FirstName] $a1[LastName],\nYour login details are:\n\nUsername: $a1[username]\nPassword: $a1[password]\n\n$site_url";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";
return(mail($to, $subject, $message, $headers));
require_once("templates/ForgotYes.php");
require_once("templates/FooterTemplate.php");
exit();
}
else
{
$error2 = "<center><font face=verdana size=2 color=red>There is no username <b>$_POST[u2]</b> at our database!</font></center>";
}
}
[/COLOR]