title: Apex Schedulable Class: SendEmail failed INVALID_SA​VE_AS_ACTI​VITY_FLAG saveAsActi​vity must be false
body: <p>I am new to apex and am trying to build an apex schedule class that runs everyday. If the account review date for commisions is two weeks (14 days) away the scheduler will send an email to our Sales Department.</p>
  
  <p>I have a made a class that implements the schedulable interface. I am currently testing to make sure my code works. I've created a test method, but I'm not sure it works. I got this error email:</p>
  
  <p>Sandbox</p>
  
  <p>caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_SAVE_AS_ACTIVITY_FLAG, saveAsActivity must be false when sending mail to users.: []</p>
  
  <p>Class.AccountReviewSchedulerOtherObjectIDETest.sen​dEmail: line 15, column 1</p>
  
  <p>Class.AccountReviewSchedulerOtherObjectIDETest.exe​cute: line 5, column 1</p>
  
  <p>Without a test method, I get no response from my scheduler (not an error email or the email I am trying to send.</p>
  
  <p>Here is my Apex Scheduled Class (with test method)</p>
  
  <pre><code>global class AccountReviewSchedulerOtherObjectIDETest implements Schedulable{ 
  global void execute (SchedulableContext ctx) 
  { 
  
  sendEmail(); 
  
  }
  public void sendEmail()
  {
  
  
  Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 
  mail.setTemplateId('00XF0000000LfE0'); 
  mail.setTargetObjectId('005J0000000JWYx'); 
  Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail }); 
  }
  
  public static testMethod void testschedule() {
  
  Test.StartTest();
  AccountReviewSchedulerOtherObjectID sh1 = new AccountReviewSchedulerOtherObjectID();
  
  Test.stopTest();
  
  }
  }
  </code></pre>
  
  <p>What does this error mean? Is my test class written the wrong way? Is something wrong with my email method?</p>