You need to sign in to do that
Don't have an account?

"common.apex.methods.MessagingStaticMethods$EmailExecutionException: SendEmail failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Either the plain text body or html body must be supplied:
Hi,
I'm getting following error while trying to run a scheduled job in the Production :
"common.apex.methods.MessagingStaticMethods$EmailExecutionException: SendEmail failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Either the plain text body or html body must be supplied:
This code worked fine in the Sandbox.
Any suggestion towards circumventing this problem will be much appreciated.
Thanks & Regards,
Debendra
I'm getting following error while trying to run a scheduled job in the Production :
"common.apex.methods.MessagingStaticMethods$EmailExecutionException: SendEmail failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Either the plain text body or html body must be supplied:
This code worked fine in the Sandbox.
Any suggestion towards circumventing this problem will be much appreciated.
Thanks & Regards,
Debendra
To send Email from Apex your code should contain plain text body or HTML body as shown below. . I believe your scheduled job is not able to set either setHTMLBody or setPlainTextBody properly . I mean its setting with NULL values .Please make sure you are handling null values properly.