I have the following method that has been working fine until today, I have not changed anything with the code.

    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    if(cc != null) { mail.setCcAddresses(cc); }   
    mail.setSenderDisplayName('Salesforce Messaging');
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

When I try to deploy I get:

Error: Compile Error: Method does not exist or incorrect signature: void sendEmail(List) from the type Messaging

This started today in both Sandbox and Production.

Does anyone know whats going on?


1 Answer 1


The Messaging namespace is being "shadowed" by a variable or class by the same name. If you did not change that class, odds are, someone created a new class in your org called Messaging, which in turn would cause compilation errors for any classes that use the standard Messaging library. You'll want to remove or rename that class so it does not conflict with your code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .