How to check if SMTP is working from commandline (Linux) [closed]

Syntax for establishing a raw network connection using telnet is this:

telnet {domain_name} {port_number}

So telnet to your SMTP server like

telnet smtp.mydomain.example 25

And copy and paste the below

helo client.mydomain.example
mail from:<sender@mydomain.example>
rcpt to:<to_email@mydomain.example>
data
From: test@mydomain.example
Subject: test mail from command line

this is test number 1
sent from linux box
.
quit

Note : Do not forgot the “.” at the end which represents the end of the message.
The “quit” line exits ends the session.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)