Relay to switch 24v dc (low current) with 240v ac mains?
What you want is a relay.  There are many available with coils rated for 240 VAC.  Now you only have to pick one that can switch 24 VDC at whatever your maximum current is.  Fortunately for you, most relays with 240 VAC coils will be able to switch 24 VDC at a few 100 mA easily, but always check the datasheet carefully.