Mailx recipient from mysql database

Dear All,

Can I make Mailx to read recipient address from a mysql database?

I already tried emailing with bash script:

SUBJECT="TEST"
export EMAIL_ADDRESS=`mysql -uroot -pabcde smsd -e "SELECT email FROM recipient"`
mysql -uroot -pabcde smsd -e "SELECT ID, SenderName, Body FROM inbox" | mailx -s "$SUBJECT" -a From:sales@acme.com "$EMAIL_ADDRESS�

It return this error:

export: 13: supervisor@gmail.com: bad variable name

the table has 2 row with two email address each.

but no luck. Any help would be very appriciated. Thanks

Please use code tags as required by forum rules!

What's not working? Pls post error msgs.

What do those mysql commands return when run alone from the command line?

Dear RudiC

Ok thanks, i already fix my post.