[![Git](https://git-scm.com/images/logo@2x.png)](https://git-scm.com/) --fast-version-control
![](https://git-scm.com/images/dark-mode.svg)
  * [About](https://git-scm.com/about)
    * [Trademark](https://git-scm.com/about/trademark)
  * [Learn](https://git-scm.com/learn)
    * [Book](https://git-scm.com/book)
    * [Cheat Sheet](https://git-scm.com/cheat-sheet)
    * [Videos](https://git-scm.com/videos)
    * [External Links](https://git-scm.com/doc/ext)
  * [Tools](https://git-scm.com/tools)
    * [Command Line](https://git-scm.com/tools/command-line)
    * [GUIs](https://git-scm.com/tools/guis)
    * [Hosting](https://git-scm.com/tools/hosting)
  * [Reference](https://git-scm.com/docs)
  * [Install](https://git-scm.com/install/linux)
  * [Community](https://git-scm.com/community)


  * Table of Contents
    * [NAME](https://git-scm.com/docs/git-imap-send#_name)
    * [SYNOPSIS](https://git-scm.com/docs/git-imap-send#_synopsis)
    * [DESCRIPTION](https://git-scm.com/docs/git-imap-send#_description)
    * [OPTIONS](https://git-scm.com/docs/git-imap-send#_options)
    * [CONFIGURATION](https://git-scm.com/docs/git-imap-send#_configuration)
    * [GETTING A LIST OF AVAILABLE FOLDERS](https://git-scm.com/docs/git-imap-send#_getting_a_list_of_available_folders)
    * [EXAMPLES](https://git-scm.com/docs/git-imap-send#_examples)
    * [CAUTION](https://git-scm.com/docs/git-imap-send#_caution)
    * [SEE ALSO](https://git-scm.com/docs/git-imap-send#_see_also)
    * [GIT](https://git-scm.com/docs/git-imap-send#_git)


[ English ▾](https://git-scm.com/docs/git-imap-send)
Localized versions of **git-imap-send** manual
  1. [English ](https://git-scm.com/docs/git-imap-send)
  2. [Français ](https://git-scm.com/docs/git-imap-send/fr)
  3. [Português (Brasil) ](https://git-scm.com/docs/git-imap-send/pt_BR)
  4. [українська мова ](https://git-scm.com/docs/git-imap-send/uk)
  5. [简体中文 ](https://git-scm.com/docs/git-imap-send/zh_HANS-CN)

Want to read in your language or fix typos?
[You can help translate this page](https://github.com/jnavila/git-manpages-l10n).
[Topics ▾](https://git-scm.com/docs/git-imap-send)
### Setup and Config
  * [ git ](https://git-scm.com/docs/git)
  * [ config ](https://git-scm.com/docs/git-config)
  * [ help ](https://git-scm.com/docs/git-help)
  * [ bugreport ](https://git-scm.com/docs/git-bugreport)
  * [ Credential helpers ](https://git-scm.com/doc/credential-helpers)


### Getting and Creating Projects
  * [ init ](https://git-scm.com/docs/git-init)
  * [ clone ](https://git-scm.com/docs/git-clone)


### Basic Snapshotting
  * [ add ](https://git-scm.com/docs/git-add)
  * [ status ](https://git-scm.com/docs/git-status)
  * [ diff ](https://git-scm.com/docs/git-diff)
  * [ commit ](https://git-scm.com/docs/git-commit)
  * [ notes ](https://git-scm.com/docs/git-notes)
  * [ restore ](https://git-scm.com/docs/git-restore)
  * [ reset ](https://git-scm.com/docs/git-reset)
  * [ rm ](https://git-scm.com/docs/git-rm)
  * [ mv ](https://git-scm.com/docs/git-mv)


### Branching and Merging
  * [ branch ](https://git-scm.com/docs/git-branch)
  * [ checkout ](https://git-scm.com/docs/git-checkout)
  * [ switch ](https://git-scm.com/docs/git-switch)
  * [ merge ](https://git-scm.com/docs/git-merge)
  * [ mergetool ](https://git-scm.com/docs/git-mergetool)
  * [ log ](https://git-scm.com/docs/git-log)
  * [ stash ](https://git-scm.com/docs/git-stash)
  * [ tag ](https://git-scm.com/docs/git-tag)
  * [ worktree ](https://git-scm.com/docs/git-worktree)


### Sharing and Updating Projects
  * [ fetch ](https://git-scm.com/docs/git-fetch)
  * [ pull ](https://git-scm.com/docs/git-pull)
  * [ push ](https://git-scm.com/docs/git-push)
  * [ remote ](https://git-scm.com/docs/git-remote)
  * [ submodule ](https://git-scm.com/docs/git-submodule)


### Inspection and Comparison
  * [ show ](https://git-scm.com/docs/git-show)
  * [ log ](https://git-scm.com/docs/git-log)
  * [ diff ](https://git-scm.com/docs/git-diff)
  * [ difftool ](https://git-scm.com/docs/git-difftool)
  * [ range-diff ](https://git-scm.com/docs/git-range-diff)
  * [ shortlog ](https://git-scm.com/docs/git-shortlog)
  * [ describe ](https://git-scm.com/docs/git-describe)


### Patching
  * [ apply ](https://git-scm.com/docs/git-apply)
  * [ cherry-pick ](https://git-scm.com/docs/git-cherry-pick)
  * [ diff ](https://git-scm.com/docs/git-diff)
  * [ rebase ](https://git-scm.com/docs/git-rebase)
  * [ revert ](https://git-scm.com/docs/git-revert)


### Debugging
  * [ bisect ](https://git-scm.com/docs/git-bisect)
  * [ blame ](https://git-scm.com/docs/git-blame)
  * [ grep ](https://git-scm.com/docs/git-grep)


### Email
  * [ am ](https://git-scm.com/docs/git-am)
  * [ apply ](https://git-scm.com/docs/git-apply)
  * [ imap-send ](https://git-scm.com/docs/git-imap-send)
  * [ format-patch ](https://git-scm.com/docs/git-format-patch)
  * [ send-email ](https://git-scm.com/docs/git-send-email)
  * [ request-pull ](https://git-scm.com/docs/git-request-pull)


### External Systems
  * [ svn ](https://git-scm.com/docs/git-svn)
  * [ fast-import ](https://git-scm.com/docs/git-fast-import)


### Server Admin
  * [ daemon ](https://git-scm.com/docs/git-daemon)
  * [ update-server-info ](https://git-scm.com/docs/git-update-server-info)


### Guides
  * [ gitattributes ](https://git-scm.com/docs/gitattributes)
  * [ Command-line interface conventions ](https://git-scm.com/docs/gitcli)
  * [ Everyday Git ](https://git-scm.com/docs/giteveryday)
  * [ Frequently Asked Questions (FAQ) ](https://git-scm.com/docs/gitfaq)
  * [ Glossary ](https://git-scm.com/docs/gitglossary)
  * [ Hooks ](https://git-scm.com/docs/githooks)
  * [ gitignore ](https://git-scm.com/docs/gitignore)
  * [ gitmodules ](https://git-scm.com/docs/gitmodules)
  * [ Revisions ](https://git-scm.com/docs/gitrevisions)
  * [ Submodules ](https://git-scm.com/docs/gitsubmodules)
  * [ Tutorial ](https://git-scm.com/docs/gittutorial)
  * [ Workflows ](https://git-scm.com/docs/gitworkflows)
  * [ All guides... ](https://git-scm.com/docs/git#_guides)


### Administration
  * [ clean ](https://git-scm.com/docs/git-clean)
  * [ gc ](https://git-scm.com/docs/git-gc)
  * [ fsck ](https://git-scm.com/docs/git-fsck)
  * [ reflog ](https://git-scm.com/docs/git-reflog)
  * [ filter-branch ](https://git-scm.com/docs/git-filter-branch)
  * [ instaweb ](https://git-scm.com/docs/git-instaweb)
  * [ archive ](https://git-scm.com/docs/git-archive)
  * [ bundle ](https://git-scm.com/docs/git-bundle)


### Plumbing Commands
  * [ cat-file ](https://git-scm.com/docs/git-cat-file)
  * [ check-ignore ](https://git-scm.com/docs/git-check-ignore)
  * [ checkout-index ](https://git-scm.com/docs/git-checkout-index)
  * [ commit-tree ](https://git-scm.com/docs/git-commit-tree)
  * [ count-objects ](https://git-scm.com/docs/git-count-objects)
  * [ diff-index ](https://git-scm.com/docs/git-diff-index)
  * [ for-each-ref ](https://git-scm.com/docs/git-for-each-ref)
  * [ hash-object ](https://git-scm.com/docs/git-hash-object)
  * [ ls-files ](https://git-scm.com/docs/git-ls-files)
  * [ ls-tree ](https://git-scm.com/docs/git-ls-tree)
  * [ merge-base ](https://git-scm.com/docs/git-merge-base)
  * [ read-tree ](https://git-scm.com/docs/git-read-tree)
  * [ rev-list ](https://git-scm.com/docs/git-rev-list)
  * [ rev-parse ](https://git-scm.com/docs/git-rev-parse)
  * [ show-ref ](https://git-scm.com/docs/git-show-ref)
  * [ symbolic-ref ](https://git-scm.com/docs/git-symbolic-ref)
  * [ update-index ](https://git-scm.com/docs/git-update-index)
  * [ update-ref ](https://git-scm.com/docs/git-update-ref)
  * [ verify-pack ](https://git-scm.com/docs/git-verify-pack)
  * [ write-tree ](https://git-scm.com/docs/git-write-tree)


[ Latest version ▾ ](https://git-scm.com/docs/git-imap-send) git-imap-send last updated in 2.51.0
Changes in the **git-imap-send** manual
  1. 2.51.1 → 2.53.0 no changes
  2. [2.51.0 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2025-08-18_ ](https://git-scm.com/docs/git-imap-send/2.51.0)
  3. 2.43.2 → 2.50.1 no changes
  4. [2.43.1 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2024-02-09_ ](https://git-scm.com/docs/git-imap-send/2.43.1)
  5. [2.43.0 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2023-11-20_ ](https://git-scm.com/docs/git-imap-send/2.43.0)
  6. 2.38.1 → 2.42.4 no changes
  7. [2.38.0 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2022-10-02_ ](https://git-scm.com/docs/git-imap-send/2.38.0)
  8. 2.29.1 → 2.37.7 no changes
  9. [2.29.0 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2020-10-19_ ](https://git-scm.com/docs/git-imap-send/2.29.0)
  10. 2.20.1 → 2.28.1 no changes
  11. [2.20.0 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2018-12-09_ ](https://git-scm.com/docs/git-imap-send/2.20.0)
  12. 2.19.1 → 2.19.6 no changes
  13. [2.19.0 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2018-09-10_ ](https://git-scm.com/docs/git-imap-send/2.19.0)
  14. 2.18.1 → 2.18.5 no changes
  15. [2.18.0 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2018-06-21_ ](https://git-scm.com/docs/git-imap-send/2.18.0)
  16. 2.4.12 → 2.17.6 no changes
  17. [2.3.10 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2015-09-28_ ](https://git-scm.com/docs/git-imap-send/2.3.10)
  18. [2.2.3 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2015-09-04_ ](https://git-scm.com/docs/git-imap-send/2.2.3)
  19. 2.1.4 no changes
  20. [2.0.5 ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/green-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/red-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) ![](https://git-scm.com/images/icons/grey-dot.png) _2014-12-17_ ](https://git-scm.com/docs/git-imap-send/2.0.5)


Check your version of git by running
`git --version`
##  [](https://git-scm.com/docs/git-imap-send#_name)NAME
git-imap-send - Send a collection of patches from stdin to an IMAP folder
##  [](https://git-scm.com/docs/git-imap-send#_synopsis)SYNOPSIS
```
_git imap-send_ [-v] [-q] [--[no-]curl] [(--folder|-f) <folder>]
_git imap-send_ --list
```

##  [](https://git-scm.com/docs/git-imap-send#_description)DESCRIPTION
This command uploads a mailbox generated with `git` `format-patch` into an IMAP drafts folder. This allows patches to be sent as other email is when using mail clients that cannot read mailbox files directly. The command also works with any general mailbox in which emails have the fields `From`, `Date`, and `Subject` in that order.
Typical usage is something like:
```
$ git format-patch --signoff --stdout --attach origin | git imap-send
```

##  [](https://git-scm.com/docs/git-imap-send#_options)OPTIONS

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt--v)-v


[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt---verbose)--verbose

Be verbose.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt--q)-q


[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt---quiet)--quiet

Be quiet.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt--ffolder)-f <folder>


[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt---folderfolder)--folder=<folder>

Specify the folder in which the emails have to saved. For example: `--folder=`[`Gmail`]`/Drafts` or `-f` `INBOX/Drafts`.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt---curl)--curl

Use libcurl to communicate with the IMAP server, unless tunneling into it. Ignored if Git was built without the USE_CURL_FOR_IMAP_SEND option set.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt---no-curl)--no-curl

Talk to the IMAP server using git’s own IMAP routines instead of using libcurl. Ignored if Git was built with the NO_OPENSSL option set.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt---list)--list

Run the IMAP LIST command to output a list of all the folders present.
##  [](https://git-scm.com/docs/git-imap-send#_configuration)CONFIGURATION
To use the tool, `imap.folder` and either `imap.tunnel` or `imap.host` must be set to appropriate values.
Everything above this line in this section isn’t included from the [git-config[1]](https://git-scm.com/docs/git-config) documentation. The content that follows is the same as what’s found there:

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt-imapfolder)imap.folder

The folder to drop the mails into, which is typically the Drafts folder. For example: `INBOX.Drafts`, `INBOX/Drafts` or [`Gmail`]`/Drafts`. The IMAP folder to interact with MUST be specified; the value of this configuration variable is used as the fallback default value when the `--folder` option is not given.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt-imaptunnel)imap.tunnel

Command used to set up a tunnel to the IMAP server through which commands will be piped instead of using a direct network connection to the server. Required when imap.host is not set.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt-imaphost)imap.host

A URL identifying the server. Use an `imap://` prefix for non-secure connections and an `imaps://` prefix for secure connections. Ignored when imap.tunnel is set, but required otherwise.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt-imapuser)imap.user

The username to use when logging in to the server.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt-imappass)imap.pass

The password to use when logging in to the server.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt-imapport)imap.port

An integer port number to connect to on the server. Defaults to 143 for imap:// hosts and 993 for imaps:// hosts. Ignored when imap.tunnel is set.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt-imapsslverify)imap.sslverify

A boolean to enable/disable verification of the server certificate used by the SSL/TLS connection. Default is `true`. Ignored when imap.tunnel is set.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt-imappreformattedHTML)imap.preformattedHTML

A boolean to enable/disable the use of html encoding when sending a patch. An html encoded patch will be bracketed with <pre> and have a content type of text/html. Ironically, enabling this option causes Thunderbird to send the patch as a plain/text, format=fixed email. Default is `false`.

[](https://git-scm.com/docs/git-imap-send#Documentation/git-imap-send.txt-imapauthMethod)imap.authMethod

Specify the authentication method for authenticating with the IMAP server. If Git was built with the NO_CURL option, or if your curl version is older than 7.34.0, or if you’re running git-imap-send with the `--no-curl` option, the only supported methods are `PLAIN`, `CRAM-MD5`, `OAUTHBEARER` and `XOAUTH2`. If this is not set then `git` `imap-send` uses the basic IMAP plaintext `LOGIN` command.
##  [](https://git-scm.com/docs/git-imap-send#_getting_a_list_of_available_folders)GETTING A LIST OF AVAILABLE FOLDERS
In order to send an email to a specific folder, you need to know the correct name of intended folder in your mailbox. The names like "Junk", "Trash" etc. displayed by various email clients need not be the actual names of the folders stored in the mail server of your email provider.
In order to get the correct folder name to be used with `git` `imap-send`, you can run `git` `imap-send` `--list`. This will display a list of valid folder names. An example of such an output when run on a Gmail account is:
```
* LIST (\HasNoChildren) "/" "INBOX"
* LIST (\HasChildren \Noselect) "/" "[Gmail]"
* LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail"
* LIST (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts"
* LIST (\HasNoChildren \Important) "/" "[Gmail]/Important"
* LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
* LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam"
* LIST (\Flagged \HasNoChildren) "/" "[Gmail]/Starred"
* LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash"
```

Here, you can observe that the correct name for the "Junk" folder is [`Gmail`]`/Spam` and for the "Trash" folder is [`Gmail`]`/Trash`. Similar logic can be used to determine other folders as well.
##  [](https://git-scm.com/docs/git-imap-send#_examples)EXAMPLES
Using tunnel mode:
```
[imap]
    folder = "INBOX.Drafts"
    tunnel = "ssh -q -C user@example.com /usr/bin/imapd ./Maildir 2> /dev/null"
```

Using direct mode:
```
[imap]
    folder = "INBOX.Drafts"
    host = imap://imap.example.com
    user = bob
    pass = p4ssw0rd
```

Using direct mode with SSL:
```
[imap]
    folder = "INBOX.Drafts"
    host = imaps://imap.example.com
    user = bob
    pass = p4ssw0rd
    port = 123
    ; sslVerify = false
```

Note |  You may want to use `sslVerify=false` while troubleshooting, if you suspect that the reason you are having trouble connecting is because the certificate you use at the private server `example.com` you are trying to set up (or have set up) may not be verified correctly.
---|---
Using Gmail’s IMAP interface:
```
[imap]
    folder = "[Gmail]/Drafts"
    host = imaps://imap.gmail.com
    user = user@gmail.com
    port = 993
```

Gmail does not allow using your regular password for `git` `imap-send`. If you have multi-factor authentication set up on your Gmail account, you can generate an app-specific password for use with `git` `imap-send`. Visit <https://security.google.com/settings/security/apppasswords> to create it. Alternatively, use OAuth2.0 authentication as described below.
Note |  You might need to instead use: `folder` `=` `"`[`Google` `Mail`]`/Drafts"` if you get an error that the "Folder doesn’t exist". You can also run `git` `imap-send` `--list` to get a list of available folders.
---|---
Note |  If your Gmail account is set to another language than English, the name of the "Drafts" folder will be localized.
---|---
If you want to use OAuth2.0 based authentication, you can specify `OAUTHBEARER` or `XOAUTH2` mechanism in your config. It is more secure than using app-specific passwords, and also does not enforce the need of having multi-factor authentication. You will have to use an OAuth2.0 access token in place of your password when using this authentication.
```
[imap]
    folder = "[Gmail]/Drafts"
    host = imaps://imap.gmail.com
    user = user@gmail.com
    port = 993
    authmethod = OAUTHBEARER
```

Using Outlook’s IMAP interface:
Unlike Gmail, Outlook only supports OAuth2.0 based authentication. Also, it supports only `XOAUTH2` as the mechanism.
```
[imap]
    folder = "Drafts"
    host = imaps://outlook.office365.com
    user = user@outlook.com
    port = 993
    authmethod = XOAUTH2
```

Once the commits are ready to be sent, run the following command:
```
$ git format-patch --cover-letter -M --stdout origin/master | git imap-send
```

Just make sure to disable line wrapping in the email client (Gmail’s web interface will wrap lines no matter what, so you need to use a real IMAP client).
In case you are using OAuth2.0 authentication, it is easier to use credential helpers to generate tokens. Credential helpers suggested in [git-send-email[1]](https://git-scm.com/docs/git-send-email) can be used for `git` `imap-send` as well.
##  [](https://git-scm.com/docs/git-imap-send#_caution)CAUTION
It is still your responsibility to make sure that the email message sent by your email program meets the standards of your project. Many projects do not like patches to be attached. Some mail agents will transform patches (e.g. wrap lines, send them as format=flowed) in ways that make them fail. You will get angry flames ridiculing you if you don’t check this.
Thunderbird in particular is known to be problematic. Thunderbird users may wish to visit this web page for more information: <https://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email>
##  [](https://git-scm.com/docs/git-imap-send#_see_also)SEE ALSO
[git-format-patch[1]](https://git-scm.com/docs/git-format-patch), [git-send-email[1]](https://git-scm.com/docs/git-send-email), mbox(5)
##  [](https://git-scm.com/docs/git-imap-send#_git)GIT
Part of the [git[1]](https://git-scm.com/docs/git) suite
### imap-send
[About this site](https://git-scm.com/site)
Patches, suggestions, and comments are welcome.
Git is a member of [Software Freedom Conservancy](https://git-scm.com/sfc)
