0
votes

WHile working on an Apex Script, I ran into this error (while testing it) Line: 4, Column: 14 Method does not exist or incorrect signature: void sendMail(String, String, String) from the type EmailManager

Is there a reason why? Please let me know. Thank you.

This is the Apex code:

public 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 });
    }
}
1

1 Answers

0
votes

sendMail takes 3 arguments sendMail(String, String, String){} You need to make sure in your test class that you are passing the arguments into the method so

EmailManager.sendMail('address', 'subject','body');