0

hi..

im trying to send email to the user who register to my website..

SMTP server response: 501 5.5.4 Invalid Address in D:\Domains\lelys.org\wwwroot\reg_save.php on line 66

this is the error im getting..

if($res)
{
	//echo "record added";
	//$count = 1;
	$to = $mail;
	$sub = "Confirm Mail From LeLys";
	$header = "from: LeLys<support@lelys.org>";
	
	$message = "confirm link \r\n";
	$message.= "click to activete your account \r\n";
	$message.= "http://www.lelys.org/confirmation.php?key=$ccode";
	
	$sending = mail($to,$sub,$message,$header);
	
		if($sending)
			{
				//echo ("email comfirm");
?>
		

<body>
<table width="100%" border="0" align="center" bgcolor="#DAF5FE">
  <tr>
    <td height="233"><table width="94%" border="1" align="center" bgcolor="#F0FCFF">
      <tr>
        <td height="178"><center><h2>Your Details have been Added</h2><br />Please check for a Confirmation email</center></td>
      </tr>
    </table></td>
  </tr>
</table>
<?php
}
		else
			echo("email not sent");

}

this is the code im using..

and

$sending = mail($to,$sub,$message,$header);

this is line 66 in my code.. PLZ HELP...

4
Contributors
7
Replies
9
Views
8 Years
Discussion Span
Last Post by network18
1

Well try adding the following line just before the mail function to see if the address to is being stored properly.

echo '<h1>'.$to.'</h1>';

It should display the email address and if it doesn't then your problem is that the variable $mail hasn't got any email address assigned.

0

i tried it..

the email id is echoed prefectly in <h1> tags...

still get the same error,,

SMTP server response: 501 5.5.4 Invalid Address in D:\Domains\lelys.org\wwwroot\reg_save.php on line 66

0

Well try commenting the following line and also make sure the to address is valid.

$header = "from: LeLys<support@lelys.org>";
0

Also, try sending a simple mail to see if it works.

<?php
mail("youraddress@domain.com","test","test mail ! Hope it works","from: youraddress@domain.com");
?>

If it does, then its obvious that you missed out something in your other script.

Edited by nav33n: n/a

0

hi guys...

i changed the code as u said n tested it..

now im getting a different error..

Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay

wat do this thing means ?

im totally stuck wit this thing.. cant now forward with this prob..

0

If you tried nav33n's script and got that error first I would suggest to make sure the two email addresses in his code are not the same and are valid email addresses. If the problem continues then try contacting your web host as their SMTP server may need configuring. Also include in the email to your web host nav33n's code but with the real email addresses which do not match.

2

Many Internet Service Providers (ISP's) require that you send your username and password before you are allowed to send email. This is called "Authentication" or "SMTP Auth".

More recently, some ISP's have begun to require that you have TWO separate and different login names - one for checking mail and one for sending mail. This is called "SMTP Relay".
So there might be the problem with your smtp server settings, check with it.

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.