All Projects → octocat-mona → KP.GmailClient

octocat-mona / KP.GmailClient

Licence: GPL-2.0 license
A Gmail client for C#

Programming Languages

C#
18002 projects

Labels

Projects that are alternatives of or similar to KP.GmailClient

smtplib-bruteforce
bruteforcing gmail (TLS/SSL)
Stars: ✭ 26 (+52.94%)
Mutual labels:  mail, gmail
Imapcopy
Recursively copy all e-mail messages and folders from one IMAP account to another.
Stars: ✭ 52 (+205.88%)
Mutual labels:  mail, gmail
Gatsby Mail
A Gatsby email *application*
Stars: ✭ 450 (+2547.06%)
Mutual labels:  mail, gmail
Free Email Forwarding
The best free email forwarding for custom domains. Visit our website to get started (SMTP server)
Stars: ✭ 2,024 (+11805.88%)
Mutual labels:  mail, gmail
Inboxer
Unofficial, free and open-source Inbox by Gmail Desktop App
Stars: ✭ 668 (+3829.41%)
Mutual labels:  mail, gmail
Forwardemail.net
The best free email forwarding for custom domains (Web Server)
Stars: ✭ 211 (+1141.18%)
Mutual labels:  mail, gmail
CYMailDemo
A mail client base on mailcore2
Stars: ✭ 14 (-17.65%)
Mutual labels:  mail
sendcloud
SendCloud Mail SDK
Stars: ✭ 21 (+23.53%)
Mutual labels:  mail
ModMail
A Discord ModMail Bot.
Stars: ✭ 54 (+217.65%)
Mutual labels:  mail
GmailBruterV2
Simple tool written in python3 to perform limited brute-force attacks on gmail accounts.
Stars: ✭ 264 (+1452.94%)
Mutual labels:  gmail
yapople
Yet another POP3 email library
Stars: ✭ 22 (+29.41%)
Mutual labels:  mail
mail
golang send mail with SSL,TLS and support NTLM,LOGIN,PLAIN AUTH...
Stars: ✭ 29 (+70.59%)
Mutual labels:  mail
mailparse
Rust library to parse mail files
Stars: ✭ 148 (+770.59%)
Mutual labels:  mail
shifting
A privacy-focused list of alternatives to mainstream services to help the competition.
Stars: ✭ 31 (+82.35%)
Mutual labels:  gmail
Android-Email-App-using-Javamail-Api
An Android App to send mail without gamil/email interaction!
Stars: ✭ 19 (+11.76%)
Mutual labels:  mail
hermes
Automates programmables à réaction aux échanges électroniques depuis une boîte IMAP4
Stars: ✭ 15 (-11.76%)
Mutual labels:  mail
easymail
Easy way to install a mail server.
Stars: ✭ 60 (+252.94%)
Mutual labels:  mail
gopistolet
Mailserver written in Go
Stars: ✭ 59 (+247.06%)
Mutual labels:  mail
enough mail app
Mail app for iOS, Android and hopefully more platforms in the future. Based on Flutter.
Stars: ✭ 84 (+394.12%)
Mutual labels:  mail
MBOX
Check your Gmail on linux via TERMINAL!
Stars: ✭ 13 (-23.53%)
Mutual labels:  gmail

NuGet version (KP.GmailClient) Build status

KP.GmailClient

This is an alternative client for the auto generated Google.Apis.Gmail.v1 Client Library.

Prerequisites

  1. Create a new project in the Google Cloud Console (Guide)
  2. Create a OAuth consent screen (Guide)
    1. Publish the app or add any test users
  3. Create Desktop application credentials and download the client secret JSON file (Guide)
  4. Enable the Gmail API

Setup

One-time setup which opens the browser to authenticate the user.

// Define the required scopes
const GmailScopes scopes = GmailScopes.Readonly | GmailScopes.Send;

var broker = new GmailAuthenticationBroker();
var token = await broker.AuthenticateAsync("oauth_client_credentials.json", scopes);

var tokenStore = new FileTokenStore("token.json");
await tokenStore.StoreTokenAsync(token);

Usage examples

// Use the previously created files
var tokenClient = TokenClient.Create("oauth_client_credentials.json");
var tokenStore = new FileTokenStore("token.json");
using var client = new GmailClient(tokenClient, tokenStore);


// Send a plain text email
Message plainMessage = await client.Messages.SendAsync("[email protected]", "Subject", "Plain text body");

// Send a HTML email
Message htmlMessage = await client.Messages.SendAsync("[email protected]", "Subject", "<h1>HTML body</h1>", isBodyHtml: true);

// Get the users profile
Profile profile = await client.GetProfileAsync();

// Get inbox messages
IList<Message> messages = await client.Messages.ListAsync();

// Get starred messages
IList<Message> starredMessages = await client.Messages.ListByLabelAsync(Label.Starred);

// List all labels
IList<Label> labels = await client.Labels.ListAsync();

// List all drafts
IList<Draft> drafts = await client.Drafts.ListAsync();
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].