Read a file with in UNIX and send multiple mails

Hi-I want to create a shell script which should read a file line by line (file having email address and transaction id of each user)and send email on email ids with the transaction id of the user respectively.

Please help - I think a while loop should help but I am very new too UNIX Shell scripting.Its quite urgent.

Thanks

assume input file:

me@mycomp.com 12345555
you@yourcomp.com 999555
while read addr tnum
do
   echo "$tnum" | /usr/bin/mailx -s 'your transaction' "$addr"
done < inputfile