combining mega 2560 R3 with ethernet v2 and relay v2 shields ?

Hello,

I am trying to make a controller that can control relays and can be connect to the internet.

is it possible to use arduino mega r3 combined with the ethernet v2 and relays v2 shields?

if it is, i will love to hear how.

thanks a lot.

Yes it should be, I wouldn't know why it shouldn't.

For the code it depends on what you want to do.
If you need to know the connection diagram just google the modules documentation...

ethernet v2 and relays v2 shields

What are these shields? Provide a link to each shield. They may or may not stack.