Send & Receive Mail Steps
The Send Mail and Receive Mail steps integrate email into test automation — useful for account verification, password reset and notification workflows.
When to Use
- Testing email-based flows: verification codes, password resets, notifications.
- Asserting that a system sent the expected message to a mailbox.
- Extracting a link or code from an email to drive the next step.
Why: Email is often the only observable side-effect of a workflow (a verification link, a reset token). These steps let you drive and assert that channel like any other.
Send Mail Step
Display name: Send Mail (SMTP). Sends an email over SMTP.
Configuration (SMTP Settings tab)
| Field | Description |
|---|---|
| Server Address | SMTP host (default smtp.yourprovider.xyz). Supports ${VariableName}. |
| Port | SMTP port (default 587). |
| SSL | Use SSL/TLS (true by default). |
| STARTTLS | Use STARTTLS (true by default). |
| Username | SMTP authentication username. |
| Password | SMTP password — stored encrypted; use ${VariableName} for secrets. |
| Server Response | Read-only response returned by the server. |
A Connection Profile picker (type Smtp) can supply all of the above; when active, the inline fields are hidden. Two further tabs are available:
- MIME Message — the
MailMessageeditor (MimeMessageEditor). - Raw Message — read-only rendered raw message.
Attachments are configured as a list of file names (relative, resolved from the project files/ folder); ${VariableName} substitution is supported on each entry. Missing files are logged as diagnostics and skipped.
The MIME message and attachments are combined at send time. The step returns RunResult.Success on a successful SmtpClient.Send, otherwise RunResult.Failure.
Receive Mail Step
Display name: Receive Mail. Connects to a mailbox over IMAP or POP3 and selects matching messages.
Configuration (Server Configuration tab)
| Field | Description |
|---|---|
| Protocol | IMAP (default) or POP3. |
| Server Address | IMAP/POP3 host (e.g. imap.yourserver.com). Supports ${VariableName}. |
| Port | Server port (default 993). |
| SSL/TLS | Enable TLS (true by default). |
| STARTTLS | Enable STARTTLS (false by default). |
| Username | Mailbox username. Supports ${VariableName}. |
| Password | Mailbox password (or app password). Stored encrypted. |
A Connection Profile picker (type MailInbox) can supply the protocol, server, port, TLS options and credentials; when active the inline fields are hidden.
Configuration (Mail filter tab)
The Filters expander contains:
| Field | Description |
|---|---|
| Subject Filter | Selects mail by subject; supports ${VariableName}. |
| Filtering Mode | An Action (compare action: AreEqual, Contains, GreaterThan, …) and a Mode (compare mode: Binary, CaseInsensitive, Loose, RegularExpression, RegularExpressionIgnoreCase, NodeExists, NodeNotExists). |
| Time Filter | Only select mail received within this TimeSpan. |
| Limit | Maximum number of recent mails to check (default 10). |
| Wait Timeout | Maximum time to wait for a matching mail (default 2 minutes). The step re-checks every 15 seconds until a match or the timeout. |
Matched messages are listed in the Retrived Messages grid (Action / Subject / From / Date) with an Open button. Selected messages are available in MimeMessages.
If no mail matches the subject filter before the wait timeout, the step returns RunResult.Failure with "No Email matchs the Subject filter. Test failed."
Common Pattern: Email Verification Flow
Step 1: Send Request (POST /register) → stores ${VerificationCode}
Step 2: Wait (00:00:05) — wait for email delivery
Step 3: Receive Mail
Protocol: IMAP
Subject Filter: "Verify your account" (Mode: Contains)
→ matched messages in MimeMessages
Step 4: C# Script — extract verification link from the message
Step 5: Send Request (GET <link>)
Step 6: Assert (Status Code = 200)