You need to sign in to do that
Don't have an account?
EvertonSzekeres
Schedule email
Hi,
I'm trying to send an email scheduling by a date field in my task:
I had scheduled, but I didn't receive the email.
Probably my code is wrong, it is my first time scheduling.
What should I do?
Thanks !
I'm trying to send an email scheduling by a date field in my task:
global class Email_agendado_Impressao implements Schedulable { global void execute(SchedulableContext sc) { for (Task t: [select Id, E_mail__c, Data_do_pedido__c from Task where subject = 'Fotos faltantes - Envio de Backup']){ if (t.Data_do_pedido__c == system.today()){ Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); String[] toAddresses = new String[]{}; toAddresses.add(t.e_mail__c); mail.setToAddresses(toAddresses); mail.setSenderDisplayName('Test email'); mail.setSubject('Test Schedule'); mail.setPlainTextBody('Test email'); } } } }
I had scheduled, but I didn't receive the email.
Probably my code is wrong, it is my first time scheduling.
What should I do?
Thanks !
All Answers
Let me know how you get on.
I forgot this...haha..
Thanks Shyam, It will work now.
Thanks for warning.
Now I'm having difficulty to create a test class.