Nodemailer / Sendgrid with apikey
<p>I am trying to get a simple contact form up and running in node.js with sendgrid using an apikey. It's unclear where I am going wrong.</p>

<p>I tried the following:
1.</p>

<pre><code>var options = {
    auth: {
        api_user: 'xjh-4XqZGH6$HLT-IEOPFG',
        api_key: 'SG.xjh-4XqZGH6$HLT-IEOPFG.Wl2rB-CN00-nj3x5NiKno7MpDk8DxTtvgJeZfDGGI' // fake obviously, but I would like to show the structure as I am not sure whether this is correct
    }
};
</code></pre>

<p>and
2.</p>

<pre><code>var options = {
    auth: {
        api_user: 'xjh-4XqZGH6$HLT-IEOPFG',
        api_key: 'Wl2rB-CN00-nj3x5NiKno7MpDk8DxTtvgJeZfDGGI' // fake obviously, but I would like to show the structure as I am not sure whether this is correct
    }
};
</code></pre>

<p>and
3.</p>

<pre><code>var options = {
    auth: {
        api_user: 'apikey',
        api_key: 'SG.xnh-4XqZGH6$HLT-IEOPFG.Wl2rB-CN00-nj3x5NiKno7MpDk8DxTtvgJeZfDGGI' // fake obviously, but I would like to show the structure as I am not sure whether this is correct
    }
};
</code></pre>

<p>It keeps coming back with badusername / password.</p>

<p>It works fine with my username (api_user) and password (api_key).</p>

<p>Can anyone explain what I need to do?</p>

<p>Cheers, Mike</p>