“NO_MASS_MAIL_PERMISSION” Error While Sending Email From Apex

If you are getting this error message while sending email using “Messaging.SingleEmailMessage” System.EmailException: SendEmail failed. First exception on row 0; first error: NO_MASS_MAIL_PERMISSION, Single email is not enabled for your organization or profile. Single email must be enabled for you to use this feature.: [] Step to resolution Make sure Email Deliverability is turned on. …

“NO_MASS_MAIL_PERMISSION” Error While Sending Email From Apex Read More »

Convert epoch to datetime in Apex

We get this requirement while coding several time to convert epoch time (Unix time) to Datetime. First thing, never store a epoch time in Integer and use Long always. Below given code can be used to convert into datetime: To get the epoch from a datetime variable you can just call the getTime() instance method: