How can I send smtp mail via gmail and osx Lion mailx?
One way to fix this is to install the official server app in order to re-enable this feature.  You don't have to setup a mail server through the app.  Just installing it will allow use of mailx through the command line.

In the past, you had to buy and install OS X server as a separate product and now it's available from the App Store and gets installed on top of the normal OS.