Using sendEmail with Gmail

I try to sending an E-Mail via Gmail and sendEmail. I have try some configurations but nothing works.


sendEmail \
-o tls=yes \
-f  \
-t  \
-s smtp.gmail.com:587 \
-xu  \
-xp some-safty-password \
-u Hello World \
-m This is an E-Mail text.

RESULT: sendEmail[11181]: ERROR => ERROR => SMTP-AUTH: Authentication to smtp.gmail.com:587 failed.


sendEmail \
-o tls=yes \
-f  \
-t  \
-s smtp.gmail.com:465 \
-xu  \
-xp some-safty-password \
-u Hello World \
-m This is an E-Mail text.

RESULT:  sendEmail[11213]: ERROR => smtp.gmail.com:465 returned a zero byte response to our query.

I have try with and without TLS. I have activate POP, IMAP and SMTP on Gmail account.

Whats wrong with my config?

1

1 Answer

Find a solution with comment from andrew.46. I have to activate 'use less secure apps' in Google-Account (). Than following code works:

sendEmail \
-o tls=yes \
-f  \
-t  \
-s smtp.gmail.com:587 \
-xu  \
-xp some-safty-password \
-u Hello World \
-m This is an E-Mail text.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest