http://qs321.pair.com?node_id=483789


in reply to sendmail in 1 millisecond

Network related operations (such as Email) are asynchronous, they should be handled asynchronously. Well, you can fork() a child process (or lots of child processes), and let each of them handle a sendmail request, and your main process can carry on doing other stuff.

There are a few examples here in the monastery that does what I described above. Check out the multi-threaded network ping example. Well, you have to search the monastery for the code, I am not going to provide the link here.