I'm working through the trailhead projects, and am currently on the one where I need to create a class to send an email (https://developer.salesforce.com/trailhead/project/salesforce_developer_workshop/creating_apex_class).
It's all pretty straight forward copy/paste stuff but I've run into a problem.
I'm on Step 3, using a static method and have the code copied from the site:
public class EmailManager {
public with sharing class EmailManager{
public static void sendMail(String address, String subject, String body) {
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[] {address};
mail.setToAddresses(toAddresses);
mail.setSubject(subject);
mail.setPlainTextBody(body);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}
}
And I'm then testing using the Execute Anonymous window using:
String address = 'kris@************.com';
String subject = 'Speaker Confirmation';
String body = 'Thank you for speaking at the conference.';
EmailManager.sendMail(address, subject, body);
Every time I try this, I get the error
Line: 4, Column: 1 Method does not exist or incorrect signature: EmailManager.sendMail(String, String, String)
Any suggestions?