Add timeouts to outgoing SMTP mail

I wasn't able to test if this actually fixes the problem we're running into since it's hard to simulate an unresponsive SMTP server. At the very least, these timeouts seem reasonable and shouldn't hurt anything except very slow SMTP servers.