php ile mail atmak istiyorsan phpmailler güzel bir örnek

http://sourceforge.net/projects/phpmailer/

buradan indirirek yapabilirsin