How can i create a self-executing php script?

Hi all ,

I want to create a php-script that sends emails to users every week
How can this be done ?