There is no queue. You get an exception from the mail sending method if the SMTP communication fails. Your best choice is to use a local smarthost, that is, an SMTP server such as sendmail, qmail, postfix, a Java-based server, etc. Then connect locally to that server, which will queue and spool your messages for you (and do many other things).
Thanks a lot for your response, I will try this.