Web applications which send out email notifications as part of their user interaction process normally works fine, but as they grow in terms of number of users it tends to feel slower in parts where email is sending out in background. Reason is obvious, your smtp server has to handle more request then before and it takes time to process each email request, so your main application thread has to wait (and so does user).

Solution is simple, just isolate your email sending functions by creating separate thread (and also set it on low priority). This way your main application thread (and thus your users) does not have to wait them processed.

I have seen simple functions to take around 30 seconds to process just because email sending function is waiting in background just to get an time out error from smtp server.