Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. static void testmethod testEmails()
  2. {
  3. // prep data
  4.  
  5. // attempt to send email
  6. try
  7. {
  8. /* code that calls Messaging.sendEmail */
  9. }
  10. catch (EmailException e)
  11. {
  12. // ignore if Single Emails aren't configured yet
  13. if (e.getMessage().contains('Single email must be enabled')) {}
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement