popen is a very simple function to use. It allows you to open a system command as a FILE stream, for reading or writing. To send an email, you will want to open a stream for writing so you can...
My 'liedentd' is a simple select(2)-based server program that is a good example of how to write a high-performance select loop. It is available in the FreeBSD ports system, under security/liedentd,...