Send Mac OS X Mail via gmail User defined From address

Trying to configure my Mac OS X Mail program to send mail using my
chosen From address.

I am sure that when I first configured it a year or so ago it worked
fine but now any mail always appears with my gmail address as the From
address rather than the address I chose in Mail.

Any ideas what has changed or what I need to do?