Email via my web page

I want to create a web page in jsp in which after a certain limit of counter my program can send me message on my phone and email on my email id. It is possible in java but how i do not know. I need some help of yours.