I would like to be able to send email from utility/batch/launchd scripts via my gmail account and the mailx client that is bundled in OS X Lion. I cannot find how to configure this. I found http://www.andrews-corner.org/mutt.html#sending which describes doing this for mutt, but I'd rather not have to install mutt. I do have Thunderbird installed and use that to read/send mail (instead of Mail.app).
When I run mailx -v -s subject email@example.com < file.txt I get no errors, but instead of getting an SMTP transaction log, mailx tells me
Mail Delivery Status Report will be mailed to <David>.
Worse, there is no /var/mail/David folder, so this report appears to go into a bitbucket.