title: Nodemailer/Gmail - What exactly is a refresh token and how do I get one?
body: <p>I'm trying to do a simple contact form in a node app, using <code>nodemailer</code>. I want all the msg to be sent from a gmail account I made for this purpose, to my personnal mail. </p>
  
  <p>on the client side, all I do is to get the name/mail/message of the customer and send it to the server. It works fine locally but fails to work when deployed (on heroku btw). </p>
  
  <p>After a quick search, it seems I have to generate a <code>ClientId</code> and <code>ClientSecret</code> from Google Developers Console - which I did - but when it comes to generating a "refresh token" iI'm completely lost. </p>
  
  <pre><code>    var smtpTransport = nodemailer.createTransport("SMTP",{
          service:"Gmail",
          auth:{
              XOAuth2: {
                  user:"myaccount@gmail.com",
                  clientId:"",
                  clientSecret:"",
                  refreshToken:""
              }
          }
      });
  </code></pre>
  
  <p><strong>I am confused</strong> : What exactly is a refresh token and how do I get one ? </p>