Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8114015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:01:12+00:00 2026-06-06T03:01:12+00:00

For educational purposes, I need to send an email through an SMTP server, using

  • 0

For educational purposes, I need to send an email through an SMTP server, using SMTP’s fundamental and simple rules.

I was able to do that using smtp4dev. I telnet localhost 25 and and commands are:

enter image description here

I want to do the same thing, using Gmail SMTP server. However, it requires authentication and TLS. I can’t figure out how to do that for Gmail. Here’s a screenshot of telnet smtp.gmail.com 587:

enter image description here

I searched and found many links including Wikipedia’s article about STARTTLS command. But I’m not able to use TLS and authenticate to Gmail’s SMTP server using command line (or sending commands myself in programming languages). Can anyone help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:01:14+00:00Added an answer on June 6, 2026 at 3:01 am

    to send over gmail, you need to use an encrypted connection. this is not possible with telnet alone, but you can use tools like openssl

    either connect using the starttls option in openssl to convert the plain connection to encrypted…

    openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf -ign_eof

    or connect to a ssl sockect directly…

    openssl s_client -connect smtp.gmail.com:465 -crlf -ign_eof

    EHLO localhost

    after that, authenticate to the server using the base64 encoded username/password

    AUTH PLAIN AG15ZW1haWxAZ21haWwuY29tAG15cGFzc3dvcmQ=

    to get this from the commandline:

    echo -ne '\00user@gmail.com\00password' | base64
    AHVzZXJAZ21haWwuY29tAHBhc3N3b3Jk
    

    then continue with “mail from:” like in your example

    example session:

    openssl s_client -connect smtp.gmail.com:465 -crlf -ign_eof
    [... lots of openssl output ...]
    220 mx.google.com ESMTP m46sm11546481eeh.9
    EHLO localhost
    250-mx.google.com at your service, [1.2.3.4]
    250-SIZE 35882577
    250-8BITMIME
    250-AUTH LOGIN PLAIN XOAUTH
    250 ENHANCEDSTATUSCODES
    AUTH PLAIN AG5pY2UudHJ5QGdtYWlsLmNvbQBub2l0c25vdG15cGFzc3dvcmQ=
    235 2.7.0 Accepted
    MAIL FROM: <gryphius-demo@gmail.com>
    250 2.1.0 OK m46sm11546481eeh.9
    rcpt to: <somepoorguy@example.com>
    250 2.1.5 OK m46sm11546481eeh.9
    DATA
    354  Go ahead m46sm11546481eeh.9
    Subject: it works
    
    yay!
    .
    250 2.0.0 OK 1339757532 m46sm11546481eeh.9
    quit
    221 2.0.0 closing connection m46sm11546481eeh.9
    read:errno=0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing some wxWidgets samples for educational purposes. My problem is simple: I'm using
I'm trying to write my own C++ String class for educational and need purposes.
I need both of them on one computer, first for educational purposes and second
Hey Simple little app for educational purposes, its a simple uitableview and I want
For educational purposes I tried to make a server and client where the server
For pure educational purposes, what should I write instead of * such that I
I am trying to build my own simple MVC framework, mainly for educational purposes
In educational purposes I'm writing a HTTP server in C++. When receiving a request,
I am writing a super tiny web server for educational purposes. For the following
I want to write a simple compiler for educational purposes in Delphi. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.