This is very good link to learn with examples about PHP fuction :
http://php.net/manual/en/function.mail.php