I can heartily recommend postfix http://www.postfix.org/
It's a good idea to keep a logical separation between the sending MTA and the receiving MTA (separate hostnames at the least, separate machines/instances is best because you can manage security policy better).
Do plan on keeping the SMTP operations separate from the web application, and if your application is going to read email, plan on building spamfiltering in from the beginning.