How to send an Email by using custom fuction??

How to send an Email by using custom fuction??

Hello 
I tried custom function which is given under developers space 
i written a code of sending mail code is working but not receiving any mails,
please help me out