Warning: mail(): SMTP server response: 501 Syntax error in parameters or arguments
Results 1 to 2 of 2

Thread: Warning: mail(): SMTP server response: 501 Syntax error in parameters or arguments

  1. #1
    Junior Member
    Join Date
    Sep 2005
    Posts
    1

    Warning: mail(): SMTP server response: 501 Syntax error in parameters or arguments

    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:

    Code:
    
    
    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>";
    
    	}
    }
    
    
    Last edited by earunder; 09-13-2005 at 10:32 AM.

  2. #2
    Senior Member drew010's Avatar
    Join Date
    Apr 2003
    Location
    Santa Rosa, CA
    Posts
    2,828
    have you echoed out the body and headers to see what they look like on screen? also headers should be delimited by \r\n instead of just \n

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •