FANDOM


SMTP is a network protocol for exchanging e-mails.

Testing Edit

To test an SMTP server you can telnet to the SMTP port of it and send the SMTP commands:

telnet smtp.example.com 25

A sample SMTP session[1]:

S: 220 smtp.example.com ESMTP Postfix
C: HELO relay.example.org
S: 250 Hello relay.example.org, I am glad to meet you
C: MAIL FROM:<bob@example.org>
S: 250 Ok
C: RCPT TO:<alice@example.com>
S: 250 Ok
C: RCPT TO:<theboss@example.com>
S: 250 Ok
C: DATA
S: 354 End data with <CR><LF>.<CR><LF>
C: From: "Bob Example" <bob@example.org>
C: To: Alice Example <alice@example.com>
C: Cc: theboss@example.com
C: Date: Tue, 15 Jan 2008 16:02:43 -0500
C: Subject: Test message
C:
C: Hello Alice.
C: This is a test message with 5 headers and 4 lines in the body.
C: Your friend,
C: Bob
C: .
S: 250 Ok: queued as 12345
C: QUIT
S: 221 Bye
{The server closes the connection}

You can use the following bash script to test SMTP easily:

echo open $1 25
sleep 2
echo HELO relay.example.org
echo "MAIL FROM:<test@example.org>"
echo "RCPT TO:<$2>"
echo DATA
sleep 2
echo This is a test...
echo .
echo QUIT
sleep 2

You need to give it arguments for the server to connect to and the e-mail address to send to and then you need to pipe the output to telnet, like this:

./smtptest example.com recipient@example.com | telnet

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.