title: Meteor [Error: Can't wait without a fiber] after a call to Email.send
body: <p>I've created a very simple server using Meteor, to send an email after a timeout. When I use a timeout, the message is successfully sent but an error is thrown: <code>[Error: Can't wait without a fiber]</code>.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>if (Meteor.isServer) {
    Meteor.startup(function () {
      // &lt;DUMMY VALUES: PLEASE CHANGE&gt;
      process.env.MAIL_URL = 'smtp://me%40example.com:PASSWORD@smtp.example.com:25';
      var to = 'you@example.com'
      var from = 'me@example.com'
      // &lt;/DUMMY&gt;
      // 
      var subject = 'Message'
      var message = "Hello Meteor"
  
      var eta_ms = 10000
      var timeout = setTimeout(sendMail, eta_ms);
      console.log(eta_ms)
  
      function sendMail() {
        console.log("Sending...")
        try {
          Email.send({
            to: to,
            from: from,
            subject: subject,
            text: message
          })
        } catch (error) {
          console.log("Email.send error:", error)
        }
      }
    })
  }
  </code></pre>
  
  <p>I understand that I could use <code>Meteor.wrapAsync</code> to create a fiber. But <code>wrapAsync</code> expects there to be a callback to call, and <code>Email.send</code> doesn't use a callback.</p>
  
  <p>What should I do to get rid of the error?</p>