Tuesday 19 August 2014

Telnet: SMTP Commands To Send Email

To send an email via Exchange using telnet:

telnet mail.server.com 25
220 mail.server.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at  Tue, 19 Aug 2014 14:51:42 +0100
EHLO test.com
250-mail.server.com Hello [192.168.0.1]
MAIL FROM:admin@test.com
250 2.1.0 admin@test.com....Sender OK
RCPT TO: user@domain.com
250 2.1.5 user@domain.com
DATA
354 Start mail input; end with <CRLF>.<CRLF>
FROM: admin@test.com
TO: user@domain.com
Subject: Test Message

Press Enter two times. You will not receive a response from this command.
This is a test message.
.
250 2.6.0 <MAILSRV001FRaqbC8wSA00000047@mail.server.com> Queued mail for delivery
QUIT
221 2.0.0 mail.server.com Service closing transmission channel

Connection to host lost.

No comments:

Post a Comment