Click here to Skip to main content
15,906,463 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have hmailer installed and configured.

But each time I attempt to send a mail I get this error:

( ! ) Warning: mail(): SMTP server response: 550 The address is not valid. in C:\wamp\www\TestMail.php on line 8

PHP
<?php
$from = "myusername@yahoo.com";
$to = "myusername@gmail.com";

$message = "This is a test";
$subject = "Test";

if(mail($to,$subject,$message))//This is line 8.
{

	printf("Mail sent.");
}
else
{
	print("Mail not sent");
}
?>


What could be wrong?
Posted
Updated 28-Dec-15 16:53pm
v3
Comments
Gokulprasad05 28-Dec-15 23:10pm    
change printf to print
Gbenbam 29-Dec-15 8:55am    
That was a typo.
Richard MacCutchan 29-Dec-15 5:12am    
Exactly what the message tells you. One of those email addresses is not valid.
Gbenbam 29-Dec-15 8:55am    
Please how is that so? I still can see it.
Richard MacCutchan 29-Dec-15 10:51am    
Sorry, you need to use your debugger to collect more information. You should also read http://php.net/manual/en/function.mail.php.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900