Saturday, August 13, 2016

How To Send E-mail Via Telnet with Authentication

This is How to blog, Send E-mail or Test SMTP details via Telnet with Authentication enable Server.

When Required :-

For System Administrator, many time is required to test SMTP details from a server to check connectivity between an APP server and SMTP Server.


This could be required in many cases, 

1- Dev team complaining, Emails are not releasing their apps or ContactUS page.

2-  E-mail notification stopped suddenly.

3-  And Much more cases can be

Requirement :-

1- One working PC either Windows or Linux.
2- Telnet Client must be installed.

Step 1-

Install Telnet Client -

Please review below link:-

- How To Enable Telnet In Windows Server 2008

- How to Install Telnet in Linux Server


Step 2 -

Test SMTP Credentials : Telnet session support 64bit encoded USERNAME and PASSWORD Only.
In my Scenario, I am encoding my Email Account Username and Password this URL
http://ostermiller.org/calc/encode.html

Open Terminal Session -


# [root@cent ~]# telnet mail.smtp.com 25
Trying 98.130.1.236...
Connected to mail.smtp.com.
Escape character is '^]'.
220 mail1214.opentransfer.com ESMTP
EHLO smtp.com
250-mail1214.opentransfer.com
250-PIPELINING
250-8BITMIME
250-SIZE 0
250 AUTH LOGIN PLAIN CRAM-MD5
AUTH LOGIN
334 VXNlcm5hbWU6
U2VuZGVyQHNtdHAuY29t (User_Name Encoded using this http://ostermiller.org/calc/encode.html)

334 UGFzc3dvcmQ6
cGFzc3dvcmQ= (Password Encoded using this http://ostermiller.org/calc/encode.html)

235 ok, go ahead (#2.0.0)
MAIL FROM:Sender@smtp.com
250 ok
RCPT TO:recipient@gmail.com
250 ok
DATA
354 go ahead
Subject:test email from Telnet session 

Test e-mail from WEB Server test!!
.
250 ok 1471072596 qp 11882
quit
221 mail1214.opentransfer.com
Connection closed by foreign host.
[root@cent ~]#

If everything goes well you get 250 Ok message in last. and check your test email in the recipient's Email Acccount


That's All
!!!Cheers!!!

No comments:

Post a Comment