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
Name | Description |
---|---|
Input | |
To | Specifies the main recipients of the email message. String variables containing one or multiple email addresses separated by a semicolon (; ). |
From | Specifies the email address of the sender of the email message. String variables containing the sender's email address. |
Specifies the email account from which the message will be sent. String variables containing the email account. | |
Password | Specifies the password of the email account used to send the email message. String variables containing the email account password. |
Server | Specifies the host name (e.g., "smtp.gmail.com") to establish a connection with the SMTP server. String variables containing the server host name. |
Port | Specifies the port used to connect to the email server and send the email message. Integer variables containing the port number. |
Is HTML | Specifies whether the body of the email message is written in HTML format. Boolean variables indicating whether the email body is HTML. |
Subject | Specifies the subject line for the email to be sent. String variables containing the email subject. |
Body | Specifies the email body content that you want to send in the email message. String variables containing the email body. |
CC | Specifies additional recipients who should receive a copy of the email message. String variables containing one or multiple email addresses separated by a semicolon (; ). |
BCC | Specifies recipients who should receive the email message as hidden recipients. String variables containing one or multiple email addresses separated by a semicolon (; ). |
Attachments | Specifies a list of file paths for attachments to be included with the email. List variables containing strings representing file paths. |
Mail Message | Specifies the MailMessage object to be forwarded. This field only supports MailMessage objects. Variables of type System.Net.Mail.MailMessage . |
Output | |
Success | Returns true or false based on whether the email message was sent successfully. Boolean variables indicating the success of the email sending operation. |
Exception | If an exception occurs while executing the sequence, this property stores the exception message for further processing. String variables containing the exception message. |
Misc | |
Display Name | The display name of the activity. A display name is automatically generated when you indicate a target. |
Optional | |
Delay | Specifies 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
- Drag and drop the "Send SMTP Mail" activity onto the workflow.
- Configure the properties by specifying the necessary information such as recipients, sender details, server details, email content, and attachments.
- Optionally, configure the delay and customize the display name.
- 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.