I have a script that uses PHP mail() function to send emails:
mail(“me@mydomain.com”, “Subject”, “Message”);
Everything worked fine until yesterday. Now the mails either end up in a dead.letter file or just don’t get sent.
What could be the reason for this? Any hints into how do I debug such code?
When sendmail can’t send mail, it saves the message in a file named “dead.letter”.
Your sendmail is probably misconfigured or not running at all.
Edit: you may want to inspect /var/log/maillog to check for debug info from sendmail.