# The Complete List of SMTP Commands and Their Functions

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "WebPage",
  "headline": "22 SMTP Commands and Their Functions Explained",
  "description": "This guide discusses what SMTP commands are and their role in emails. It also contains a list of 22 SMTP commands along with their function.",
  "image": "https://res.cloudinary.com/mailmodo/image/upload/v1722099562/strapi/SMTP_Commands_63b968eddd.png",
  "datePublished": "2024-07-26T14:26:36.864Z",
  "dateModified": "2025-03-18T03:35:15.404Z",
  "publisher": {
    "@type": "Organization",
    "name": "Mailmodo",
    "url": "https://www.mailmodo.com/",
    "sameAs": [
      "https://www.linkedin.com/company/mailmodo/",
      "https://www.facebook.com/mailmodo/",
      "https://www.instagram.com/mailmodohq/",
      "https://www.youtube.com/@mailmodo"
    ],
    "logo": "https://www.mailmodo.com/static/images/logo/logo-full.svg",
    "description": "Mailmodo is a complete email marketing platform that helps email marketers to create and send interactive emails to drive growth and engagement.",
    "address": {
      "@type": "PostalAddress",
      "addressLocality": "Lewes",
      "addressRegion": "DE",
      "postalCode": "19958",
      "streetAddress": "Mailmodo Technologies Inc. 16192, Coastal Highway",
      "addressCountry": {
        "@type": "Country",
        "name": "US"
      }
    },
    "contactPoint": {
      "@type": "ContactPoint",
      "email": "enquiries@mailmodo.com",
      "contactType": "customer service"
    }
  }
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Article",
  "headline": "22 SMTP Commands and Their Functions Explained",
  "description": "This guide discusses what SMTP commands are and their role in emails. It also contains a list of 22 SMTP commands along with their function.",
  "image": "https://res.cloudinary.com/mailmodo/image/upload/v1722099562/strapi/SMTP_Commands_63b968eddd.png",
  "datePublished": "2024-07-26T14:26:36.864Z",
  "dateModified": "2025-03-18T03:35:15.404Z",
  "author": {
    "@type": "Person",
    "name": "Himadri Sharma",
    "url": "https://www.mailmodo.com/guides/author/himadri-sharma/"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Mailmodo",
    "logo": {
      "@type": "ImageObject",
      "url": "https://www.mailmodo.com/static/images/logo/logo-full.svg"
    }
  },
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://www.mailmodo.com/guides/smtp-commands/"
  }
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "#creator",
  "description": "Email marketing software to create and send interactive emails to maximize conversions and reinvent your user journey",
  "email": "support@mailmodo.com",
  "image": "https://www.mailmodo.com/static/images/og-image.png",
  "knowsAbout": "Email marketing",
  "legalName": "Mailmodo Technologies Inc.",
  "location": "United States",
  "logo": "https://www.mailmodo.com/static/images/logo/logo-full.svg",
  "name": "Mailmodo",
  "sameAs": [
    "https://twitter.com/mailmodo",
    "https://www.facebook.com/company/mailmodo/",
    "https://www.linkedin.com/company/mailmodo/"
  ],
  "url": "https://www.mailmodo.com/"
}
</script>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://www.mailmodo.com/"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Guides",
      "item": "https://www.mailmodo.com/guides/"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "smtp commands",
      "item": "https://www.mailmodo.com/guides/smtp-commands/"
    }
  ]
}
</script>

## Table of contents

- What are SMTP commands?
- Why do we need SMTP commands?
- Types of SMTP Commands
- Exchange of SMTP commands and server codes
- Conclusion

Emails are an integral part of our daily communication. It's as easy as typing your thoughts, hitting send, and the other person receiving it. But a lot of background processes happen to make this possible. Essential instructions, known as **SMTP commands**, are given to email servers to ensure that emails are processed and delivered efficiently. Understanding these commands can provide a deeper insight into the inner workings of email delivery.

  

This blog will explore what SMTP commands are, why they are necessary, and the types of SMTP commands used in email communication. We'll also provide a comprehensive list of key SMTP commands, complete with descriptions and syntax, to help you navigate this vital aspect of email technology.

## What are SMTP commands?

**SMTP commands are instructions used by email clients and servers to facilitate email sending, receiving, and routing.**

  

These commands are part of the [Simple Mail Transfer Protocol](https://www.mailmodo.com/guides/smtp/) (SMTP), the standard protocol for email transmission across the Internet. The SMTP protocol enables structured and efficient email data transfer between servers by issuing specific SMTP commands. Each command serves a specific function in the communication process, ensuring that emails are delivered accurately and securely.

## Why do we need SMTP commands?

SMTP commands are essential tools for managing email communication between servers. They play a key role in various technical scenarios.

-   **Setting up SMTP:** These commands are crucial for configuring SMTP on your computer or network. They help establish the connection and set parameters for email transmission.
    
-   **Troubleshooting issues:** When email problems arise, SMTP commands can help diagnose and fix issues. They allow you to interact directly with the [email server](https://www.mailmodo.com/guides/email-server/) to identify where problems may be occurring.
    
-   **Contacting your SMTP server:** Sometimes, you must communicate directly with your server for maintenance or configuration changes. Knowing the right commands ensures smooth communication.
    
-   **Advanced access:** In specialized situations, like accessing emails during a Telnet session or using a Linux shell, SMTP commands enable you to send emails in batches or manage [automated emails securely](https://www.mailmodo.com/features/email-automation-platform/).
    
-   **Running tests:** SMTP commands are also used to test the functionality of email systems. This can help ensure that emails are sent and received as expected.
    

Understanding SMTP commands can make managing email systems easier and more efficient. Even if you don't use them daily, having basic knowledge can be incredibly useful in specific situations.

<div class="highlight-gray"> <p> <strong>💡 Related guide: <a href=https://www.mailmodo.com/guides/smtp-test/></strong>What Is SMTP Testing? Benefits, Tools & How to Do</a></p> </div>

## Types of SMTP Commands

SMTP commands are divided into two main categories: client commands and server response codes. Client commands are initiated by the email client, while Server responses are codes sent by the server to indicate the status of the client commands. Each command has a specific role in the email communication process, helping ensure that emails are sent and received accurately.

### Client commands

| Command name | Command form                             | Description                                                                 |
|--------------|------------------------------------------|-----------------------------------------------------------------------------|
| HELO         | HELO [domain]                            | Introduces the client to the server and initiates the communication.         |
| EHLO         | EHLO [domain]                            | An extended version of HELO that supports additional features, like SMTP extensions. |
| MAIL FROM    | MAIL FROM:<email@example.com>            | Specifies the sender's email address for the outgoing email.                 |
| RCPT TO      | RCPT TO:<email@example.com>              | Indicates the recipient’s email address for the outgoing email.              |
| DATA         | DATA                                     | Signals that the next input will be the email's body content.                |
| RSET         | RSET                                     | Resets the current email transaction, clearing all state.                    |
| NOOP         | NOOP                                     | A no-operation command used to test the server’s response.                   |
| QUIT         | QUIT                                     | Ends the SMTP session and disconnects from the server.                       |
| VRFY         | VRFY <email@example.com>                 | Verifies if a specific email address exists on the server.                   |
| EXPN         | EXPN <mailing-list>                      | Expands a mailing list to show all the included addresses.                   |
| HELP         | HELP [command]                           | Provides help or information about an SMTP command.                         |
| STARTTLS     | STARTTLS                                 | Requests a switch to a secure TLS connection.                               |
| AUTH         | AUTH [mechanism]                         | Initiates authentication to verify the client's identity.                   |
| MAIL FROM: BODY=8BITMIME | MAIL FROM:<email@example.com> BODY=8BITMIME | Indicates that the email body may contain 8-bit data.                       |
| SIZE         | SIZE [number]                            | Specifies the email size in bytes, helping the server manage large emails.  |
| X-EXPS       | X-EXPS [parameters]                      | Uses extended parameters for server-specific features beyond standard SMTP. |
| X-DELIVERY-TIME | X-DELIVERY-TIME [time]                  | Sets or queries the expected delivery time for the email.                   |
| TURN         | TURN                                     | Allows the client and server to switch roles for specific tasks.             |
| ATRN         | ATRN <domain>                            | Requests mail relay for a specific domain, often used for on-demand relay.   |
| SOML (send or mail) | SOML FROM: <reverse-path>             | Sends the email if the recipient is logged in; if not, stores it in the recipient's mailbox for later access. |
| SEND         | SEND FROM: <reverse-path>                | Sends the email if the recipient is connected; otherwise, no attempt is made to store it. |
| SAML (send and mail) | SAML FROM: <reverse-path>             | Sends the email if the recipient is logged in and stores it in the recipient's mailbox regardless of their connection status. |


### Server responses

Server responses are codes sent by the server to indicate the status of the client commands. While not commands, these responses are crucial for understanding the outcome of each command.


| Response code | Form                     | Description                                    |
|---------------|--------------------------|------------------------------------------------|
| 250           | OK                       | The command was successful.                    |
| 421           | Service not available    | The server is temporarily unavailable.         |
| 450           | Requested action not taken | Temporary issue; action has not been taken.    |
| 451           | Requested action aborted | Command aborted due to error.                  |
| 500           | Syntax error             | The command was unrecognized due to a syntax error. |
| 550           | Requested action not taken | Mailbox unavailable.                           |
| 551           | User not local           | Forwarding to another address is suggested.    |
| 552           | Requested mail action aborted | Mailbox full.                                  |
| 553           | Requested action not taken | Syntax error in mailbox name.                  |
| 554           | Transaction failed       | Permanent error; transaction failed.           |


  

<div class="highlight-gray"> <p> <strong>💡 Related guide: <a href=https://www.mailmodo.com/guides/smtp-error-codes/></strong>29 SMTP Error Codes and How to Read and Troubleshoot Them</a></p> </div>

## Exchange of SMTP commands and server codes

When an email is sent, a series of exchanges occur between the sending and receiving servers using the SMTP. These exchanges involve commands and responses that ensure the email is properly delivered. Below is an example of how this communication takes place:

 | From           | Command                                 | Meaning                                             |
|----------------|-----------------------------------------|-----------------------------------------------------|
| Sending server | HELO client.gmail.com                   | Identifies itself with the domain name or IP address to start the conversation |
| Receiving server | 250                                   | OK                                                  |
| Sending server | MAIL FROM <mark@gmail.com>              | Specifies the sender of the email                  |
| Receiving server | 250                                   | OK                                                  |
| Sending server | RCPT TO <clair@yahoo.com>               | Specifies the recipient of the email               |
| Receiving server | 250                                   | OK                                                  |
| Sending server | DATA                                    | Request to start the transfer of email contents, date, subject line, etc. |
| Receiving server | 354                                   | Allows the sender to start the transfer of information |
| Sending server | Date: Sunday, 30 July 2023              | Date of the email                                  |
| Sending server | Subject: Welcome to the party!          | Subject of the email                               |
| Sending server |                                         | Empty line                                         |
| Sending server | We welcome you to the party. We hope to have a lot of fun together | Content of the email                               |
| Sending server | .                                       | Terminates the transfer of email contents          |
| Receiving server | 250                                   | OK                                                  |
| Sending server | QUIT                                    | Request to terminate the session                   |
| Receiving server | 221                                   | Closing session                                    |




  

## Conclusion

The seamless flow of emails we often take for granted relies on SMTP protocols and commands. Whether you're an IT professional, a developer, or just curious, knowing these commands helps you understand the email process better. By learning client commands and server responses, you can effectively manage email systems and troubleshoot issues, ensuring smooth email communication.

## Frequently Asked Questions

### What should I do if the SMTP server responds with an error after using the MAIL FROM SMTP command?

If you receive an error after issuing the MAIL FROM command, check the format and syntax of the email address you're providing. Ensure the email address is correctly formatted and the domain is valid. If the issue persists, verify that your server settings are correctly configured and that no restrictions prevent using that email address.

### How can I resolve issues when the RCPT TO SMTP command does not accept a recipient's email address?

If the RCPT TO command is not accepting the recipient's email address, it could be due to several reasons: the email address might be incorrectly formatted, the domain could be blacklisted, or the recipient's mailbox might not exist. Double-check the email address for typos and ensure the domain is valid and reachable. If necessary, contact the recipient's email server administrator for further assistance.

### What does a "421 Service not available" error mean when sending SMTP commands?

A "421 Service not available" error indicates that the email server can temporarily not process your request. This could be due to server overload, maintenance, or other temporary issues. In such cases, you should wait and try again later. If the problem persists, contact the server administrator to understand the underlying cause.

### How can I troubleshoot issues with the DATA SMTP command not being accepted?

If the DATA command is not being accepted, ensure it is issued after the correct sequence of commands (e.g., after HELO/EHLO, MAIL FROM, and RCPT TO). Also, check for any network or server configuration problems that might interrupt the command sequence. Reviewing server logs may provide more detailed information on why the command is being rejected.

### Why am I getting a "535 Authentication failed" error when using the AUTH SMTP command?

A "535 Authentication failed" error typically occurs when the credentials provided for authentication are incorrect. Double-check the username and password for typos and ensure that they match the account you're trying to access. If the credentials are correct, verify that the server's authentication method is properly configured and compatible with your client. If the issue continues, consult your email provider's support for assistance.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What should I do if the SMTP server responds with an error after using the MAIL FROM SMTP command?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "If you receive an error after issuing the MAIL FROM command, check the format and syntax of the email address you're providing. Ensure the email address is correctly formatted and the domain is valid. If the issue persists, verify that your server settings are correctly configured and that no restrictions prevent using that email address."
      }
    },
    {
      "@type": "Question",
      "name": "How can I resolve issues when the RCPT TO SMTP command does not accept a recipient's email address?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "If the RCPT TO command is not accepting the recipient's email address, it could be due to several reasons: the email address might be incorrectly formatted, the domain could be blacklisted, or the recipient's mailbox might not exist. Double-check the email address for typos and ensure the domain is valid and reachable. If necessary, contact the recipient's email server administrator for further assistance."
      }
    },
    {
      "@type": "Question",
      "name": "What does a \"421 Service not available\" error mean when sending SMTP commands?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A \"421 Service not available\" error indicates that the email server can temporarily not process your request. This could be due to server overload, maintenance, or other temporary issues. In such cases, you should wait and try again later. If the problem persists, contact the server administrator to understand the underlying cause."
      }
    },
    {
      "@type": "Question",
      "name": "How can I troubleshoot issues with the DATA SMTP command not being accepted?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "If the DATA command is not being accepted, ensure it is issued after the correct sequence of commands (e.g., after HELO/EHLO, MAIL FROM, and RCPT TO). Also, check for any network or server configuration problems that might interrupt the command sequence. Reviewing server logs may provide more detailed information on why the command is being rejected."
      }
    },
    {
      "@type": "Question",
      "name": "Why am I getting a \"535 Authentication failed\" error when using the AUTH SMTP command?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "A \"535 Authentication failed\" error typically occurs when the credentials provided for authentication are incorrect. Double-check the username and password for typos and ensure that they match the account you're trying to access. If the credentials are correct, verify that the server's authentication method is properly configured and compatible with your client. If the issue continues, consult your email provider's support for assistance."
      }
    }
  ]
}
</script>

---

**Author: Himadri Sharma**

Himadri Sharma is a skilled content marketer with 4+ years of experience in creating in-depth, SEO-optimized, long-form content. Her expertise spans PaaS, healthcare, SaaS, and edtech, catering to both B2B and B2C audiences.

