title: Send Google Mail in C# failed because of 403 Insufficient permissions
body: <p>I created a console application which sends an email to an address, it shows like:</p>
  
  <pre><code>    private static string[] Scopes = { GmailService.Scope.GmailCompose, GmailService.Scope.GmailSend };
      private static string ApplicationName = "Gmail API Quickstart";
  
      private const string SUBJECT = "Some simple subject";
      private static string[] emails = new string[] { "teodorescumihail2008@live.com" };
  
      static void Main(string[] args)
      {
          UserCredential credential;
  
          using (var stream =
              new FileStream("client_secret.json", FileMode.Open, FileAccess.Read))
          {
              string credPath = Environment.GetFolderPath(
                  Environment.SpecialFolder.Personal);
              credPath = Path.Combine(credPath, ".credentials/gmail-dotnet-quickstart.json");
  
              credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                  GoogleClientSecrets.Load(stream).Secrets,
                  Scopes,
                  "user",
                  CancellationToken.None,
                  new FileDataStore(credPath, true)).Result;
              Console.WriteLine("Credential file saved to: " + credPath);
          }
  
          // Create Gmail API service.
          var service = new GmailService(new BaseClientService.Initializer()
          {
              HttpClientInitializer = credential,
              ApplicationName = ApplicationName,
          });
  
          var msg = new AE.Net.Mail.MailMessage
          {
              Subject = SUBJECT,
              Body = "Test body",
              From = new MailAddress("teodorescumihail2008@gmail.com")
          };
  
          msg.To.Add(new MailAddress("teodorescumihail2008@live.com"));
          StringWriter sw = new StringWriter();
          msg.Save(sw);
  
          var result = service.Users.Messages.Send(new Message
          {
              Raw = Base64UrlEncode(sw.ToString())
          }, "me").Execute();
  
          Console.Read();
      }
  
      private static string Base64UrlEncode(string input)
      {
          var inputBytes = System.Text.Encoding.UTF8.GetBytes(input);
          // Special "url-safe" base64 encode.
          return Convert.ToBase64String(inputBytes)
            .Replace('+', '-')
            .Replace('/', '_')
            .Replace("=", "");
      }
  </code></pre>
  
  <p>When execute sending email, I received:</p>
  
  <p><a href="https://i.stack.imgur.com/IQidd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IQidd.png" alt="enter image description here"></a></p>
  
  <p>Where is my mistake ?</p>