How to use git-send-email correctly on Windows? What is the recommended email to use?

I use Outlook as my Email client and sendas.email as my SMTP client because it doesn’t work anymore for personal Outlook accounts.

This is how I edit the sendemail section in .gitconfig

[sendemail]
smtpserver = smtp.sendas.email
smtpuser = …


This content originally appeared on DEV Community and was authored by W3Teal

I use Outlook as my Email client and sendas.email as my SMTP client because it doesn't work anymore for personal Outlook accounts.

This is how I edit the sendemail section in .gitconfig

[sendemail]
    smtpserver = smtp.sendas.email
    smtpuser = w3teal@hotmail.com
    smtpencryption = STARTTLS
    smtpserverport = 587
    smtppass = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I ran the command as stated on the git-send-email.io website

F:\>git clone https://git.sr.ht/~sircmpwn/email-test-drive
Cloning into 'email-test-drive'...
remote: Enumerating objects: 7, done.
remote: Total 7 (delta 0), reused 0 (delta 0), pack-reused 7 (from 1)
Receiving objects: 100% (7/7), done.
Resolving deltas: 100% (1/1), done.

F:\>cd email-test-drive

To create the w3teal file, I created it manually with the content:

"I'm about to try git send-email"
F:\email-test-drive>git add w3teal

F:\email-test-drive>git commit -m "Demonstrate that I can use git send-email"
[master bfdb367] Demonstrate that I can use git send-email
 1 file changed, 1 insertion(+)
 create mode 100644 w3teal

Then I ran the Send the patch command, but it kept asking "More" and then it didn't work. (The content is only 1 line)

F:\email-test-drive>git send-email --to="~sircmpwn/email-test-drive@lists.sr.ht" HEAD^
More?
More?
Unsuccessful stat on filename containing newline at C:/Program Files/Git/mingw64/libexec/git-core\git-send-email line 828.
Unsuccessful stat on filename containing newline at C:/Program Files/Git/mingw64/libexec/git-core\git-send-email line 836.
Unsuccessful stat on filename containing newline at C:/Program Files/Git/mingw64/libexec/git-core\git-send-email line 836.
fatal: ambiguous argument 'HEAD
': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
format-patch -o /tmp/adkg7EWcIn HEAD
: command returned error: 128

I googled where the error was but there were no relevant questions, so I asked ChatGPT and I used the suggestion "Try HEAD~1 instead of HEAD^" and it seemed to work.

F:\email-test-drive>git send-email --to="~sircmpwn/email-test-drive@lists.sr.ht" HEAD~1
C:/Users/User/AppData/Local/Temp/y3oLfqnX5U/0001-Demonstrate-that-I-can-use-git-send-email.patch
(mbox) Adding cc: W3 Teal <w3teal@hotmail.com> from line 'From: W3 Teal <w3teal@hotmail.com>'

From: W3 Teal <w3teal@hotmail.com>
To: ~sircmpwn/email-test-drive@lists.sr.ht
Cc: W3 Teal <w3teal@hotmail.com>
Subject: [PATCH] Demonstrate that I can use git send-email
Date: Sat,  8 Mar 2025 10:36:27 +0700
Message-ID: <20250308033627.389-1-w3teal@hotmail.com>
X-Mailer: git-send-email 2.48.1.windows.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

    The Cc list above has been expanded by additional
    addresses found in the patch commit message. By default
    send-email prompts before sending whenever this occurs.
    This behavior is controlled by the sendemail.confirm
    configuration setting.

    For additional information, run 'git send-email --help'.
    To retain the current behavior, but squelch this message,
    run 'git config --global sendemail.confirm auto'.

Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y

After a long wait, what appeared next was:

Unable to initialize SMTP properly. Check config and use --smtp-debug. VALUES: server=smtp.sendas.email encryption=STARTTLS hello=localhost.localdomain port=587 at C:/Program Files/Git/mingw64/libexec/git-core\git-send-email line 1728, <FIN> line 1.

What is actually wrong? The configuration or should I use another email client?


This content originally appeared on DEV Community and was authored by W3Teal


Print Share Comment Cite Upload Translate Updates
APA

W3Teal | Sciencx (2025-03-08T04:28:15+00:00) How to use git-send-email correctly on Windows? What is the recommended email to use?. Retrieved from https://www.scien.cx/2025/03/08/how-to-use-git-send-email-correctly-on-windows-what-is-the-recommended-email-to-use/

MLA
" » How to use git-send-email correctly on Windows? What is the recommended email to use?." W3Teal | Sciencx - Saturday March 8, 2025, https://www.scien.cx/2025/03/08/how-to-use-git-send-email-correctly-on-windows-what-is-the-recommended-email-to-use/
HARVARD
W3Teal | Sciencx Saturday March 8, 2025 » How to use git-send-email correctly on Windows? What is the recommended email to use?., viewed ,<https://www.scien.cx/2025/03/08/how-to-use-git-send-email-correctly-on-windows-what-is-the-recommended-email-to-use/>
VANCOUVER
W3Teal | Sciencx - » How to use git-send-email correctly on Windows? What is the recommended email to use?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/03/08/how-to-use-git-send-email-correctly-on-windows-what-is-the-recommended-email-to-use/
CHICAGO
" » How to use git-send-email correctly on Windows? What is the recommended email to use?." W3Teal | Sciencx - Accessed . https://www.scien.cx/2025/03/08/how-to-use-git-send-email-correctly-on-windows-what-is-the-recommended-email-to-use/
IEEE
" » How to use git-send-email correctly on Windows? What is the recommended email to use?." W3Teal | Sciencx [Online]. Available: https://www.scien.cx/2025/03/08/how-to-use-git-send-email-correctly-on-windows-what-is-the-recommended-email-to-use/. [Accessed: ]
rf:citation
» How to use git-send-email correctly on Windows? What is the recommended email to use? | W3Teal | Sciencx | https://www.scien.cx/2025/03/08/how-to-use-git-send-email-correctly-on-windows-what-is-the-recommended-email-to-use/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.