I have had some trouble with getting cron to send emails. My ISP requires that the "From:" field match the email address the email is being sent from, otherwise the email is rejected. As cron hardcodes the "From:" field to "root (Cron Daemon)", these emails are not being sent.
I have set up msmtp and can send emails with no problem from the command line.
I have previously used msmtp as my MDA. msmtp has a configuration file with username and password of the outgoing smtp server (eg gmail) stored in my home directory. I've recently changed distributions to CentOS 6.3 for reasons of support (only supported distribution for third party software). I tried to install msmtp but it wasn't available in any of the repositories.
I've got a PHP web app set up which, when a user submits the form, sends an acknowledgement email from [email protected], and also sends details of their enquiry from the same email address to a predefined mailbox. It's running on a Debian Wheezy server.
In development I was using a Gmail account with MSMTP, which was easy to set up and worked fine.