{"id":16686962,"url":"https://github.com/paralin/sendgmailapi","last_synced_at":"2025-04-10T00:17:50.765Z","repository":{"id":249216528,"uuid":"830814320","full_name":"paralin/sendgmailapi","owner":"paralin","description":"git send-email using the gmail api","archived":false,"fork":false,"pushed_at":"2025-04-07T22:25:42.000Z","size":14,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T00:17:42.959Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paralin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-19T04:03:31.000Z","updated_at":"2025-02-24T17:15:51.000Z","dependencies_parsed_at":"2024-07-19T11:29:23.414Z","dependency_job_id":"16e0f562-c72b-438e-9f6e-b6932d2e7201","html_url":"https://github.com/paralin/sendgmailapi","commit_stats":null,"previous_names":["paralin/sendgmailapi"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fsendgmailapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fsendgmailapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fsendgmailapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paralin%2Fsendgmailapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paralin","download_url":"https://codeload.github.com/paralin/sendgmailapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131318,"owners_count":21052820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T15:07:21.946Z","updated_at":"2025-04-10T00:17:50.746Z","avatar_url":"https://github.com/paralin.png","language":"Go","readme":"# SendGmailAPI\n\n[![GoDoc Widget]][GoDoc] [![Go Report Card Widget]][Go Report Card]\n\n\u003e Send emails with git send-email over the Gmail API.\n\n[GoDoc]: https://godoc.org/github.com/paralin/sendgmailapi\n[GoDoc Widget]: https://godoc.org/github.com/paralin/sendgmailapi?status.svg\n[Go Report Card Widget]: https://goreportcard.com/badge/github.com/paralin/sendgmailapi\n[Go Report Card]: https://goreportcard.com/report/github.com/paralin/sendgmailapi\n\n## Introduction\n\nSendGmailAPI is a Go application that allows you to send emails using the Gmail\nAPI. It's particularly useful for developers who want to use `git send-email`\nwith their Gmail account, bypassing the need for SMTP configuration.\n\n\u003e **Warning**: Gmail [automatically wraps emails to 72 characters], which breaks patches sent with `git send-email`.\n\n[automatically wraps emails to 72 characters]: https://github.com/google/gmail-oauth2-tools/issues/32#issuecomment-2401237305\n\n## Setup\n\n### Enable the API\n\n1. Go to the [Google Cloud console](https://console.cloud.google.com/marketplace/product/google/gmail.googleapis.com) and enable the Gmail API.\n\n### Configure the OAuth consent screen\n\n1. In the Google Cloud console, go to [OAuth consent screen](https://console.cloud.google.com/apis/credentials/consent).\n2. For User type, select Internal, then click Create.\n3. Complete the app registration form, then click Save and Continue.\n4. Skip adding scopes and click Save and Continue.\n5. Review your app registration summary. To make changes, click Edit. If the app registration looks OK, click Back to Dashboard.\n\n### Authorize credentials for a web application\n\n1. In the Google Cloud console, go to [Credentials](https://console.cloud.google.com/apis/credentials).\n2. Click Create Credentials \u003e OAuth client ID.\n3. Click Application type \u003e Web application.\n4. In the Name field, type a name for the credential like \"sendgmailapi\".\n5. Add http://localhost:8090 as an authorized redirect URI.\n6. Click Create. The OAuth client created screen appears, showing your new Client ID and Client secret.\n7. Download the JSON file with the credentials.\n\nNote: This application now uses a local server to handle the OAuth2 flow, which is more secure and doesn't rely on external services.\n\n### Set up credentials\n\n1. Create a directory for configuration:\n   ```\n   mkdir -p ~/.config/sendgmail\n   chmod 0700 ~/.config/sendgmail\n   ```\n2. Move the downloaded JSON file to this directory:\n   ```\n   mv ~/Downloads/client_secret*.json ~/.config/sendgmail/credentials.json\n   chmod 0600 ~/.config/sendgmail/credentials.json\n   ```\n\n### Add test user\n\n1. Go back to APIs \u0026 Services \u003e OAuth consent screen in the Google Cloud console.\n2. Add your Gmail address (e.g., USERNAME@gmail.com) as a test user.\n\n## Usage\n\nInstall sendgmailapi:\n\n```\ngo install github.com/paralin/sendgmailapi@latest\n```\n\nRun the setup to get the token:\n\n```\n$(go env GOPATH)/bin/sendgmailapi -setup\n```\n\nThis will open a browser window for you to authorize the application and generate the token.\n\nOnce set up, you can use SendGmailAPI to send emails. The application reads the email content from standard input.\n\nAdd to your .gitconfig at ~/.gitconfig:\n\n```\ngit config --global sendemail.smtpServer $(go env GOPATH)/bin/sendgmailapi\n```\n\nOr to send a simple email:\n\n```\necho \"Subject: Test Email\nTo: recipient@example.com\n\nThis is a test email.\" | sendgmailapi\n```\n\n## License\n\nMIT\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalin%2Fsendgmailapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparalin%2Fsendgmailapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparalin%2Fsendgmailapi/lists"}