0

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

  • 3
    See answer: [link](https://stackoverflow.com/a/20203870/7321917) – Max Maximilian Nov 14 '17 at 17:10
  • 3
    Possible duplicate of [Print PHP Call Stack](https://stackoverflow.com/questions/1423157/print-php-call-stack) – iainn Nov 14 '17 at 17:10
  • Possible duplicate of [How can I get the error message for the mail() function?](https://stackoverflow.com/questions/3186725/how-can-i-get-the-error-message-for-the-mail-function) – Veve Nov 14 '17 at 18:04

0 Answers0