I use mysql_error() to debug scripts when interacting with a MySQL database.
$sql = "SELECT * FROM `mytable`";
$query = mysql_query($sql) or die(mysql_error();
That will generate the error found - like no database selected, etc.
My question is how do I debug mail()?
mail($to,$subj,$msg,$headers) or die("cannot send email");
If $to is unset, I will see
on my screen.
How do I change it so that I will see the exact error I see when I use mysql_error()?
Thanks for all your help.