Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Send Mail

Code Activity Grooper.Messaging

Sends an e-mail message using SMTP as part of a Grooper process.

Remarks

The Send Mail activity enables automated e-mail delivery within Grooper batch processing workflows. It is designed to send messages via SMTP, supporting dynamic content, attachments, and integration with a wide range of mail servers.

Purpose and Role

SendMail is a Code Activity that can be added to a Batch Process Step to automate the distribution of e-mail notifications, reports, or exported documents. It is typically used to notify users of processing results, deliver extracted content, or integrate with external systems via e-mail.

How It Works

When executed, Send Mail connects to the configured SMTP server using the provided credentials and server settings. It generates an e-mail message by merging template variables into the subject, body, and recipient fields, allowing for highly dynamic and context-aware messages. Attachments can be included by specifying one or more export formats, which are generated and added to the outgoing message.

The activity logs each successful send and increments a statistic for reporting purposes. If an error occurs during sending, the activity throws an exception and halts further processing, ensuring that issues are surfaced promptly.

Configuration and Usage

To use Send Mail:

  1. Configure SMTP Server Settings
    Set the 'Mail Server', 'Port No', 'Enable SSL', 'User Name', and 'Password' properties to match your SMTP provider's requirements. These settings control how the activity connects and authenticates with the mail server.

  2. Set Recipients and Message Content
    Specify the 'To' and optionally 'CC' properties as comma-separated lists of e-mail addresses. Use template variables to insert dynamic values from the current batch or folder context. Configure the 'Subject' and 'Body' properties, which also support template variables for personalized or context-sensitive content.

  3. Add Attachments (Optional)
    Attachments are generated using the configured export formats. Add one or more export format objects to the 'Attachments' property to include files with the message. Each format produces a file that is attached to the outgoing message.

Template Variables

All message fields (recipients, subject, body) support template variables, which are merged at runtime using the current Batch Folder context. For example, you can use {BatchName} or {DocumentType} to insert dynamic values. This enables highly flexible and personalized e-mail messages.

Error Handling and Logging

On success, Send Mail logs a message and increments the 'Messages Sent' statistic. If an error occurs (such as a connection failure or invalid recipient), the activity throws an exception, halting the process and surfacing the error for review.

Best Practices

  • Always test your SMTP configuration with a sample message before deploying to production.
  • Use template variables to personalize messages and ensure recipients receive relevant information.
  • Secure credentials using encrypted storage and avoid hard-coding sensitive information.
  • Monitor logs and statistics to track e-mail delivery and diagnose issues.

Integration Notes

Send Mail is compatible with most modern SMTP servers, including Office 365, Gmail, and on-premises Exchange. For providers requiring two-factor authentication, use an app password as needed. Ensure that the server and port settings match your provider's requirements, and that the sending account has permission to relay messages.

Properties

NameTypeDescription
General
Mail Message
Processing Options

See Also

Used By

Notification