In the end, the mail gets sent fine, but sendmail takes a long time to send the mail, even when I tried using it from the command line. In the log, there will this
-Dec 5 19:07:38 marlowe sendmail[2126]: My unqualified host name (marlowe) unknown; sleeping for retry
-Dec 5 19:08:38 marlowe sendmail[2126]: unable to qualify my own domain name (marlowe) -- using short name
which basically means that it can't figure out its domain name, so it sleeps for a minute, then comes back and manages to send the mail anyway.
Obviously, I want to get rid of this one-minute delay. I know this isn't really even a PHP question, but I was wondering if anyone knew how to fix this sort of thing.