I am sending an email from the PHP code. But when I send the email it return the error status. But I do not know how to get the stack trace/error.
Below is the code snippet which I am using.
if(mail($to, $subject, $message,$headers))
{
echo "Success.......................";
}
else
{
echo "Error.......................";
}
It says's error.
I want to get a detailed stack trace so I can fix the issue. Please suggest the code snippet to detect if any