You need an MTA such as sendmail, qmail, or exim. A lot of people think that sendmail is too hard to configure, and prefer exim. No matter which MTA you use, they are generally quite difficult to configure securely, and easily. It depends a lot on exactly what you want to do.
Here's some links to get you started: