Simple Mail Transfer Protocol

Reprinted by permission from Matt Mussleman

Table of Contents

SMTP Commands and Meanings

Command Name Definition Description Status
HELO Introduction    
EHLO Introduction (extended SMTP mode)    
RSET System Reset    
EXPN Expand Mailing List SMTP server returns address of final destination for any mail addressed to the specified address. Often disabled due to security risks. This command allows potential spammers to determine which addresses are valid on this host.
NOOP No Operation A null command. Does nothing.  
VERB Verbose mode Server responds to message send with a much more verbose, but non-standard, status dialogue.  
MAIL Specify Mail Sender    
TURN Mail Turn SMTP server begins dequeueing queued mail for the specified domain to the host which opened the current SMTP session. Usually disabled due to risk of dequeueing mail to an unauthorized host. See ETRN.
ETRN Extended Turn SMTP server looks up the primary MX record for the domain specified and begins dequeueing all queued mail to that host. Preferred instead of TURN. Not available on all SMTP implementations.
RCPT Specify Mail Recipient    
DATA Specify Message Content    
VRFY Verify Address SMTP server acknowledges whether specified address is valid. Often disabled for security to avoid helping potential spammers generate address lists.
DSN Delivery Status Notifications    
QUIT Quit End SMTP Session  

SMTP Messages

Example Description
EHLO sender's domain
MAIL FROM: sender address
	[RET={FULL | HDRS}] [ENVID=envid]
RCPT TO: recipient address
From: sender name <sender address>
To: recipient name <recipient address>
Subject: subject
Date: date

message body here


RET (specify whether to return full message or headers
	in case of failure)
ORCPT (specify receipt recipient)

Optional. If omitted, defaults to sender specified above
To, Subject, and Date also optional.

End with a single period on a line by itself.

220 ESMTP Sendmail 8.9.3/8.9.3; Mon, 11 Oct 1999 04:22:25 GMT
250 Hello [], pleased to meet you 
250 Sender ok 
250 Recipient ok 
DATA 354 Enter mail, end with "." on a line by itself
From: Matt 
To: Mindflip User 
Subject: Just saying hi
Date: 11 Oct 1999
I just wanted to say Hi.
250 EAA80467 Message accepted for delivery

ETRN Transactions


Format Description
EHLO domain
ETRN domain
EHLO will cause the server to do a reverse DNS lookup to verify sender.
After ETRN, server looks up primary MX for domain, and dequeues mail.  

220 ESMTP Sendmail 8.9.3/8.9.3; Mon, 11 Oct 1999 04:16:25 GMT
EHLO Hello nakula [], pleased to meet you
250 Queuing for node started

For More Information

RFC-821, Simple Mail Transfer Protocol
Original specifications of the SMTP protocol.