I wondering if there are any tools that I can use for Load Testing.

I have a 2 batch :

Batch A

Bacth B

Which both of them using the Database.Stateful and I'm calling Batch B from Batch A's finish method.

My batches roles are, among other things, to send Emails to the contact's emails, which every email have a different template.

I want to know if there are ways, to send a lot of emails to a demo emails which will not fail during the send and will not really get to anyone - just to check my heap size, cpu and numbers of email's limitation.



You can simply set Email Deliverability to "System email only", which will prevent emails created in Apex or the UI from being sent successfully. Your code will need to account for this setting by using the optional "partial success" mode:

Messaging.sendEmail(messages, false); // false will not throw exceptions on failures

This setting can be configured in Setup by searching for "Deliverability" in the quick search box on the left-hand side of the Setup screen.

  • So Actually after setting it to "System email only" I could send the email to an original contact's email! He will not get it anyway and I will not have an error. great idea thanks! – Salvation Jun 26 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.