What I was attempting to suggest what that if the machine on which your script runs was up, (both http and smtp services) and that machine used an external 'next-hop' server as it SMTP MTA, then the local machine would queue the mail until the 'next-hop' server came online.
I'm thinking it's a rather small ISP operation if everything's on one box. But, today's boxen can handle it, I guess.
Things are further complicated by what MTA is being run. In recent Sendmail builds, for example, there's a seperate queue for outgoing mail, and a seperate process that runs on a different port for these submissions. So, then it depends on what, exactly, was borken on the mail server.
Anyway you've brought up an interesting point.
As for your MAC OSX, I would assume that mail gets stuck in some dir called 'clientmqueue' until it's sent, but I dunno for sure. On BSD this dir is under /var/spool .....