function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
carbarcarbar 

Removing Email services

Hi,

 

I am trying to find out if there is any way to remove an Email service, as I can see no obvious way to do so.

 

This has become an issue because I have created a package that contains an Apex class that handles email messages.

 

I install the package in a development environment and create an Email service that uses that Apex class.  Everything works ok until I want to uninstall the package.  I can't because the Apex class is being used by the Email service, but I can't delete the Email service.

 

Any ideas?

 

Carl

Best Answer chosen by Admin (Salesforce Developers) 
rscottrscott

In a series of emails with support, I finally got the answer to this. 

 

Go to Setup > Develop > Email Services. Then click on the Email Service you want to delete to go to its detail page. At the bottom is a section called 'Email Addresses'. If you have addresses set up, delete them. When all of the addresses are removed, a delete button will appear for the service. Delete the service and then you should be able to delete the associated class.

 

Hope that helps. 

All Answers

cpetersoncpeterson

This used to be possible prior to the winter10 release.

I'm now stuck unable to uninstall a beta package in one of my orgs because of this!

 

I guess the only way to do it for now is make an empty apex class and change the email service to use that instead, but this is a major regression on the part of salesforce. 

 

Here's a class the inbound email service will accept, make this and then shift the email service to use it.

 

 

global class dummyClass implements Messaging.InboundEmailHandler { global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) { Messaging.InboundEmailResult result = new Messaging.InboundEmailresult(); return result; } }

 

 

 

Message Edited by cpeterson on 10-05-2009 05:03 PM
rscottrscott

In a series of emails with support, I finally got the answer to this. 

 

Go to Setup > Develop > Email Services. Then click on the Email Service you want to delete to go to its detail page. At the bottom is a section called 'Email Addresses'. If you have addresses set up, delete them. When all of the addresses are removed, a delete button will appear for the service. Delete the service and then you should be able to delete the associated class.

 

Hope that helps. 

This was selected as the best answer
Dave MedlicottDave Medlicott

Just a follow up on this. When you click on the Email Service Name and go into the detail and there is an email address set up, you must click View before you will see a delete button.Delete this and then when you go back to teh first back, a delete button will now appear for teh service.

Susanna Sharp 9Susanna Sharp 9
Confirming that Dave here has the ticket: Click 'View' and you'll find the ability to delete, and then you can delete the Email Service.