title: Can google apps script time-based trigger cause this problem: "554 5.4.6 Too many hops 53 (50 max):"?
body: <p>Hello I have a google docs document where I installed a simple emailing code on as follows:</p>
  <pre><code>   function sendMail() { 
          var file = DriveApp.getFileById('XXXXXXXX');
          var recipients = &quot;mymail@group1.com&quot; + &quot;mymail@group2.com&quot; + &quot;mymail@group3.com&quot;;
          MailApp.sendEmail(recipients, 'Daily Notes', 'Please see file Attached.', {
          name: file.getName(),
          attachments: [file.getAs(MimeType.PDF)]
      }); 
    }  
  </code></pre>
  <p>The code works fine it sends the email to multiple group emails which I want it to send. It has done this for a month now. But until recently, I keep receiving this Mail Delivery Subsystem after 20 minutes or 1 hour from the original email which is sent out and inside the error message email it says:</p>
  <blockquote>
  <p>&quot;The following addresses had permanent fatal errors&quot;</p>
  </blockquote>
  <p>and it points to only one of the emails I send daily mails to. It also says something like this: (reason: 554 5.4.6 Too many hops). and then this:</p>
  <blockquote>
  <p>554 5.4.6 Too many hops 53 (50 max).</p>
  </blockquote>
  <p>The Good Doc's file has Google's time-driven trigger as you can see in the image below. I wonder if somehow the trigger is running twice in the time interval I gave to it. Could it be why this is happening?</p>
  <p><a href="https://i.stack.imgur.com/X3ZBl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X3ZBl.png" alt="trigger install wizard screenshot" /></a></p>