SMTP Commands Reference

Complete reference for SMTP commands supported by CloudMails

Core Commands

EHLO hostname

Extended Hello. Identifies sending host and requests extended SMTP features.

220 smtp.cloudmails.eu ESMTP ready EHLO example.com 250-smtp.cloudmails.eu 250-AUTH LOGIN PLAIN 250-STARTTLS 250 SIZE 52428800

AUTH LOGIN

Authenticate with username and password (base64 encoded).

AUTH LOGIN 334 VXNlcm5hbWU6 dXNlcm5hbWU= 334 UGFzc3dvcmQ6 cGFzc3dvcmQ= 235 Authentication successful

MAIL FROM: sender@example.com

Specifies the sender email address. SIZE parameter indicates message size.

MAIL FROM: noreply@yourdomain.com SIZE=10240 250 OK

RCPT TO: recipient@example.com

Specifies the recipient email address. Can specify multiple.

RCPT TO: recipient@example.com 250 OK

DATA

Begins message body transmission. Ends with CRLF.CRLF (single period on line).

DATA 354 Start input; end with <CRLF>.<CRLF> Subject: Test Email Hello, this is a test! . 250 OK Message accepted

RSET

Reset current mail transaction. Clears sender, recipients, and message buffer.

RSET 250 OK

NOOP

No operation. Server returns OK. Used for keepalive or testing.

NOOP 250 OK

QUIT

Ends the SMTP session.

QUIT 221 smtp.cloudmails.eu closing connection

Extended Commands

STARTTLS

Start TLS encryption. Issued after EHLO to upgrade plain connection to encrypted.

STARTTLS 220 Ready to start TLS

VRFY user@example.com

Verify if email address exists. Used for email validation.

VRFY recipient@example.com 250 2.1.5 recipient@example.com # or 550 5.1.1 User unknown

EXPN alias@example.com

Expand mailing list alias. Shows actual recipient list.

EXPN list@yourdomain.com 250 2.1.0 user1@example.com 250 2.1.1 user2@example.com

HELP

Returns help information about SMTP commands.

HELP 214-Commands supported: 214- AUTH DATA EHLO HELO MAIL NOOP QUIT RCPT RSET RTSP HELP

SMTP Response Codes

2xx - Success 220 - Service ready 250 - OK, request completed 251 - User not local, will forward 354 - Start mail input 4xx - Transient failure (retry later) 420 - Timeout 421 - Service shutting down 450 - Mailbox unavailable 451 - Local error 452 - Storage full 5xx - Permanent failure (don't retry) 500 - Syntax error 501 - Parameter error 502 - Command not implemented 503 - Bad sequence 550 - Mailbox unavailable 551 - User not local 552 - Storage full 553 - Mailbox name not allowed 554 - Transaction failed