Skip to main content

Send SMTP Mail

AutomatR.Mail.SendSMTPMail

The "Send SMTP Mail" activity in AutomatR, part of the Mail activities package, enables the automation of sending email messages using the SMTP protocol. This activity is versatile, supporting various input parameters such as recipients, sender information, server details, and more.

Properties

NameDescription
Input
ToSpecifies the main recipients of the email message. String variables containing one or multiple email addresses separated by a semicolon (;).
FromSpecifies the email address of the sender of the email message. String variables containing the sender's email address.
EmailSpecifies the email account from which the message will be sent. String variables containing the email account.
PasswordSpecifies the password of the email account used to send the email message. String variables containing the email account password.
ServerSpecifies the host name (e.g., "smtp.gmail.com") to establish a connection with the SMTP server. String variables containing the server host name.
PortSpecifies the port used to connect to the email server and send the email message. Integer variables containing the port number.
Is HTMLSpecifies whether the body of the email message is written in HTML format. Boolean variables indicating whether the email body is HTML.
SubjectSpecifies the subject line for the email to be sent. String variables containing the email subject.
BodySpecifies the email body content that you want to send in the email message. String variables containing the email body.
CCSpecifies additional recipients who should receive a copy of the email message. String variables containing one or multiple email addresses separated by a semicolon (;).
BCCSpecifies recipients who should receive the email message as hidden recipients. String variables containing one or multiple email addresses separated by a semicolon (;).
AttachmentsSpecifies a list of file paths for attachments to be included with the email. List variables containing strings representing file paths.
Mail MessageSpecifies the MailMessage object to be forwarded. This field only supports MailMessage objects. Variables of type System.Net.Mail.MailMessage.
Output
SuccessReturns true or false based on whether the email message was sent successfully. Boolean variables indicating the success of the email sending operation.
ExceptionIf an exception occurs while executing the sequence, this property stores the exception message for further processing. String variables containing the exception message.
Misc
Display NameThe display name of the activity. A display name is automatically generated when you indicate a target.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Send SMTP Mail" activity. This optional delay can help handle synchronization issues. Integer variables containing the delay duration (e.g., 5 seconds).

How to Use

  1. Drag and drop the "Send SMTP Mail" activity onto the workflow.
  2. Configure the properties by specifying the necessary information such as recipients, sender details, server details, email content, and attachments.
  3. Optionally, configure the delay and customize the display name.
  4. Execute the workflow to send the specified email.

Example

Consider an example where the "Send SMTP Mail" activity is used to send an email:

Send SMTP Mail:
Display Name: "Send Notification"
To: "recipient@example.com"
From: "sender@example.com"
Email: "sender@example.com"
Password: "password123"
Server: "smtp.example.com"
Port: 587
Is HTML: true
Subject: "Automated Notification"
Body: "<p>This is an automated notification email.</p>"
CC: "cc_recipient@example.com"
BCC: "bcc_recipient@example.com"
Attachments: ["C:\Documents\Attachment1.pdf", "C:\Documents\Attachment2.docx"]
Success: isEmailSent
Exception: emailException

In this example, the activity sends an HTML-formatted email notification to the main recipient "recipient@example.com" with carbon copy to "cc_recipient@example.com" and blind carbon copy to "bcc_recipient@example.com". Attachments "Attachment1.pdf" and "Attachment2.docx" are included. The success of the operation is stored in the Boolean variable "isEmailSent," and any exceptions are captured in the string variable "emailException" for further handling in the workflow.