You need to sign in to do that
Don't have an account?
VijayNi
Line: 4, Column: 14 Method does not exist or incorrect signature: void sendMail(String, String, String) from the type EmailManager
Hi All,
I am getting below error can you help me what is the issue here ?
public class Emailsample
{
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 });
}
}
Passing values through Anonymous Window
String address ='vijayummeda35@gmail.com';
String subject ='Speaker confirmation for the session';
String body ='thank you for speaking at the conference really appericated';
EmailManager.sendMail(address, subject, body);
I am getting below error can you help me what is the issue here ?
public class Emailsample
{
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 });
}
}
Passing values through Anonymous Window
String address ='vijayummeda35@gmail.com';
String subject ='Speaker confirmation for the session';
String body ='thank you for speaking at the conference really appericated';
EmailManager.sendMail(address, subject, body);
Can you confirm the error you are seeing is "Variable does not exist: EmailManager" ?
If so, please change your apex class name from Emailsample to EmailManager
Your class should be
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you