function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tom Hoban.ax728Tom Hoban.ax728 

Can you send email using a Visual Force Email template from a Apex Batch class?

Can you send email using a Visual Force Email template from a Apex Batch class (implements Database.Batchable...)? 

 

When I try, I get:

 

caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException: Argument Error: Parameter value is null: []

 

Running the same code from a Visual Force page, rather than a batch job, runs fine.