Using For loops is frowned upon in MMa, also using Do loops, though I use Do loops if when trying to fit everything into memory fails. However, there are quite a few ways to achieve your desired result. You could just use the Sum command and forget about any For loops like so.
Sum[i, {i, 2, 50, 2}]
Other methods are:-
Total[Range[2, 50, 2]]
Total[Table[i, {i, 2, 50, 2}]]
n = 0; Do[n = n + i, {i, 2, 50, 2}]; n
and if you must use For loop, this works
m = 0; For[n = 0, n <= 50, n += 2, m = m + n]; m