Tag: mail
SMTP with Telnet
by Hersey on Mar.09, 2009, under My Notes
Nothing spectacular here, but at times you may need to manually test an SMTP connection, so here is how (the mail server responses are italic):
telnet mailhost.domain.com 25
220 mailhost.domain.com ESMTP MAILHOST
helo yourhost.yourdomain.com
250 mailhost.domain.com Hello yourhost.yourdomain.com [yourip], pleased to meet you
mail from: youremail@yourdomain.com
250 2.1.0 Sender ok
rcpt to: recipientemail@recipientdomain.com
250 2.1.5 Recipient ok
data
354 Enter mail, end with “.” on a line by itself
Subject: Test Message
Test Message
.250 2.0.0 Message accepted for delivery
quit
The responses may vary a bit depending on the SMTP server but that is basically it.
Details on the SMTP server response codes can be found in rfc2821 check sections 4.2.2 and 4.2.3
