how to send conformation emails to users when they created thier account

this is my code.So I don’t know what sould I give in $header and $server. pls I need some help.

<?php //sending mail $to=$email; $subject="activate your account"; $headers="From:"; $server=""; ini_set("SMTP",$server); $body=" Hello $name, \ \ You need to activate your account with the given link below:$lastid&random=$random \ \ Thanks"; mail($to,$subject,$body,$headers); ?>

please read here