Problem taking input from file with for loop

I am trying to take input from a file and direct it into a bash script. This script is meant to be a foreach loop. I would like the script to process each item in the list one by one and direct the output to a file.

[root@uverse ~]# cat 1loop
#!/bin/bash
# this 2>&1 to redirect STDERR & STDOUT to file
LIST=$1
for i in "$LIST"; do
ping -c 2 "$LIST"; &> /root/error_mess
done

I have a file called ipaddresses with one ip per line.
This script works if I supply one ip after the script name upon execution, but not like this
#./1loop < ipaddresses

You can read the file like this:

#!/bin/bash

while read line
do
  # do something with "$line"
done < ipaddresses

Regards

Thanks It seems so easy when you show me how.
BTW it works well.

I am unsure where and how to place stderr and stdout to a file in this while loop. I have attempted many ways and it is not working.

Something like this?

#!/bin/bash

while read line
do
  ping -c 2 "$line" >> /root/error_mess 2>&1
done < ipaddresses

Regards