title: Apps Script: GmailApp not defined
body: <p>I'm trying to create a Google Apps Script to delete some email in bulk. The code for this doesn't really matter though as the <code>GMailApp</code> object isn't defined. I create a new project, add the following code:</p>
  <pre><code>function main() {
    var threads = GMailApp.search('.....');
  }
  </code></pre>
  <p>and I just get an error 'ReferenceError: GMailApp is not defined'. Do I have to enable the GMailApp? I thought the point of the app services was that they didn't need an API to be enabled, and that they can just be linked and used.</p>
  <p>Any help appreciated,</p>
  <p>Thanks</p>