How to test an SMTP server - Send email from command prompt
This shows how to test that an SMTP server is working correctly by issuing step by step SMTP commands using the telnet program at the Windows command prompt. This same technique works on Linux and Unix at the terminal command line. Please note that this is for testing purposes only and must NOT be used for sending any unsolicited email messages.
Brought to you by http://www.tekmaster.co.uk.
Closed Caption:
I folks today we're going to test
whether an smtp server is running
correctly you might suspect that your
outbound email is not being sent by your
smtp server and this is a technique used
to actually test whether the services
running correctly
now this is a Windows command prompt you
can run this from any other type of
command prompt as long as your system
has the telnet command then this will
work
so what you do is right here at the
command prompt type telnet space
the address of the smtp server space and
25
this is the port number that the smtp
service runs on the default is port 25
some servers may use a different number
but you'll need to find out to test that
correctly
so we type the command let me hit return
and we get a 220 response which tells me
that everything's fine so far
it's happy to take that and the service
is running and then we have to issue an
HDL command to space and anything after
that
it's not important
that tells me its communicated it's come
back with the 250 response which is an a
working command a working result and
what we do next is we specify who was
sending the test message from to do that
we use the mail from : command space you
must have spaced and that's sigh Billy
at microsoft.com it's usually best to
specify an existing domain name that you
know exists because some some mail
server systems will actually filter out
non-genuine so you could have like Billy
at abcdefg . com
it would it usually would reject it some
mail servers don't but I know for a fact
that mine does
so we return we get the 250 okay that's
fine
and then we're going to say who we are
actually going to send it to
now for my purpose i've set up a demo
email account
so to do this we type ask cpt space to
come on Stace and then . com
return accepted now we're not going to
worry about the subject of the message
we're just going to put something into
the body of the message to do that -
that we type the data command to return
and that just about anything we like
here just about any old thing will
suffice and to submit the message we hit
the . or . and return and we get the 250
ok response which tells us that the
message was accepted commands have been
all accepted a message is okay and it's
been sent
so what you probably want to do here is
quit from that and production back to
prompt and then we'll have a look at
whether the messages got through and
there it is
it's made it through from Billy and
microsoft com
just any old thing will suffice and that
tells me that the service is running
correctly it's handled it is taken the
command and it's sent an email through
so that's all working fine which tells
me my service is ok and then you have it
i will just add that some people have
been known to use this technique to spam
certainly could not condone that here at
Tech master and this is purely for
testing purposes only and we wouldn't
accept anyone doing that on our behalf
so there you go and i hope you find this
useful and i'll see you in the next
video
Video Length: 04:25
Uploaded By: Tekmaster Assist
Published: 9/17/2012
View Count: 252,114