title: Meteor says the MAIL_URL variable is not set, but it is
body: <p>I'm using this Mandrill package:</p>
  
  <p><a href="https://atmospherejs.com/wylio/mandrill" rel="nofollow">https://atmospherejs.com/wylio/mandrill</a></p>
  
  <p>When I try to send an email I get this error:</p>
  
  <pre><code>I20150423-22:09:09.078(-7)? ====== BEGIN MAIL #0 ======
  I20150423-22:09:09.078(-7)? (Mail not sent; to enable sending, set the MAIL_URL environment variable.)
  I20150423-22:09:09.079(-7)? MIME-Version: 1.0
  I20150423-22:09:09.079(-7)? From: admin@example.com
  I20150423-22:09:09.079(-7)? To: victor@example.com
  I20150423-22:09:09.079(-7)? Subject: Something something
  I20150423-22:09:09.079(-7)? Content-Type: text/html; charset=utf-8
  I20150423-22:09:09.079(-7)? Content-Transfer-Encoding: quoted-printable
  I20150423-22:09:09.079(-7)? 
  I20150423-22:09:09.079(-7)? Some kind of message content.
  I20150423-22:09:09.079(-7)? ====== END MAIL #0 ======
  </code></pre>
  
  <p>So I go into the Meteor Shell and I get this:</p>
  
  <pre><code>&gt; process.env.MAIL_URL
  'smtp://MY_MANDRILL_EMAIL:MY_MANDRILL_API_KEY@smtp.mandrillapp.com:587/'
  </code></pre>
  
  <p>Uh, so the MAIL_URL variable IS being set....</p>
  
  <p>Just to be sure, I put this in a <code>mailer.js</code> file under the <code>server</code> folder.</p>
  
  <pre><code>Meteor.startup(function () {
    process.env.MAIL_URL = 'smtp://MY_MANDRILL_EMAIL:MY_MANDRILL_API_KEY@smtp.mandrillapp.com:587/';
  });
  </code></pre>
  
  <p>The same error happens. This is just running everything in localhost.</p>
  
  <p><strong>EDIT - I got it working, but I don't know why I'm doing this:</strong></p>
  
  <p>I noticed through some console logging that the email was trying to be shot off before the environmental variable was being set, despite setting the environmental variable inside of <code>Meteor.startup()</code></p>
  
  <p>What I ended up doing was creating a <code>mailer_variable.js</code> file inside <code>server/lib</code></p>
  
  <pre><code>process.env.MAIL_URL = 'smtp://MY_MANDRILL_EMAIL:MY_MANDRILL_API_KEY@smtp.mandrillapp.com:587';
  console.log('this is the mail_url: ', process.env.MAIL_URL);
  </code></pre>
  
  <p>This works. But I'm not sure why. It certainly isn't what the Mandrill package author says I should be doing...</p>