Switch 230V 50Hz using a digital out pin
The good advice to people asking how to drive a relay to control mains voltage is: don't.  

Start with a complete solution such as those from PowerswitchTail.com and sold by many places:  Powerswitch Tail

You can get these already built or in kit form.  The 20 $ price is small price compared to damage to people or home you might incur with a home built solution.