I have class from which is used to send email. Currently i have a VF page and the class as controller. And a button on the standard layout of the custom object. When i click on the custom button send email it redirect me to VF page and from where i am sending email. But i want to send email by clicking on the send email button on the standard with out redirecting to the VF page. How can i achieve it. Please guide me if anybody have any idea.
Yes you can achieve this by below steps
step 2) You have to write a globle class in which you have to define a webservice method. Call this webservice method from button.
one more link with similar question Best practice for calling Apex methods from custom button?