How to send emails to an SMTP server using the command line under FreeBSD
The solution is to install heirloom-mailx, which is an alternate mailx command.
cd /usr/ports/mail/heirloom-mailx && make install clean
echo 'Some super relevant information' | /usr/local/bin/mailx -s 'One relevant subject' -S smtp=192.0.2.42 email@example.com
Be careful of the fact that the original mailx command is not replaced (/usr/bin/mailx).