title: Getting error in Mail send Using Nodemailer
body: <p>I create a project and follow all step written in answer of <a href="https://stackoverflow.com/questions/24098461/nodemailer-gmail-what-exactly-is-a-refresh-token-and-how-do-i-get-one">Nodemailer/Gmail - What exactly is a refresh token and how do I get one?</a> but i am error.</p>
  
  <p>I use following code:</p>
  
  <pre><code>      var smtpTransport = nodemailer.createTransport("SMTP", {
        service: "Gmail",
        connectionTimeout : "7000",
        greetingTimeout : "7000",
  
        auth: {
          XOAuth2: { 
            user: "",
              clientId: "",
              clientSecret: "",
              refreshToken: ""
          }
        }
      });
  
  
      var mailOptions = {
          from: "", 
          to:usersEmailId,
          subject: 'subject', 
          html: 'string Of Html'
      }
  
          smtpTransport.sendMail(mailOptions, function(error, response){
                                          if(error){
                                              console.log(error);
                                          }else{
                                              console.log("Message sent: " + response.message);
                                          }
  
                                          smtpTransport.close(); 
                                      });
  </code></pre>
  
  <p>Getting following error</p>
  
  <pre><code>{ [Error: Connection timeout] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', stage: 'init' }
  { [Error: Connection timeout] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', stage: 'init' }
  
  { [XOAUTH2Error: invalid_client] name: 'XOAUTH2Error', stage: 'auth' }
  { [XOAUTH2Error: invalid_client] name: 'XOAUTH2Error', stage: 'auth' }
  </code></pre>
  
  <p>and my second question is how to send attachment. I have only name of file and <code>url</code> of file.</p>