SendEmail
Sends email message with optional attachments.
Task version: 2.1.0
Required Frends version: 5.5+
Required .NET version: 6.0
Compatible Agents: Crossplatform
Task Parameters
To : String
Recipient addresses separated by ',' or ';'
Default: jane.doe@somedomain.com
Example: jane.doe@somedomain.com
Cc : String
Cc recipient addresses separated by ',' or ';'
Default: jane.doe@somedomain.com
Example: jane.doe@somedomain.com
Bcc : String
Bcc recipient addresses separated by ',' or ';'
Default: jane.doe@somedomain.com
Example: jane.doe@somedomain.com
From : String
Sender address.
Default: john.doe@somedomain.com
Example: jane.doe@somedomain.com
SenderName : String
Name of the sender.
Default: -
Example: Jane Doe
Subject : String
Email message's subject.
Default: Hello Jane
Example: Hello Jane
Message : String
Body of the message.
Default: You've got mail!
Example: You've got mail!
IsMessageHtml : Boolean
Set this true if the message is HTML.
Default: false
Example: true
MessageEncoding : String
Encoding of message body and subject. Use following table's name column for other options. https://msdn.microsoft.com/en-us/library/system.text.encoding(v=vs.110).aspx#Anchor_5
Default: utf-8
Example: utf-8
Attachments : Attachment[]
Array of Attachments to be send with the message.
Default: -
Example: [ Attachment { AttachmentType = AttachmentType.FileAttachment, FilePath = C:\pathToTheFile\test.txt, SendIfNoAttachmentsFound = false, ThrowExceptionIfAttachmentNotFound = true }, Attachment { AttachmentType = AttachmentType.AttachmentFromString, AttachmentFromString { FileContent = This is test file, FileName = testfile.txt } } ]
SMTPServer : String
SMTP server address.
Default: smtp.somedomain.com
Example: smtp.somedomain.com
Port : Int32
SMTP server port.
Default: 25
Example: 25
SecureSocket : SecureSocketOption
Choose the SecureSocketOption to use, default is Auto
Possible values:
None: Choose the SecureSocketOption to use, default is AutoAuto: Choose the SecureSocketOption to use, default is AutoSslOnConnect: Choose the SecureSocketOption to use, default is AutoStartTls: Choose the SecureSocketOption to use, default is AutoStartTlsWhenAvailable: Choose the SecureSocketOption to use, default is Auto
Default: 1
Example: SecureSocketOption.None
AcceptAllCerts : Boolean
WARNING: Setting AcceptAllCerts to true disables SSL/TLS certificate validation.
This should only be used in development/test environments with self-signed certificates.
Using this option in production environments poses significant security risks.
Default: False
Example: false
UseOAuth2 : Boolean
Set this true if SMTP server expectes OAuth token.
Default: False
Example: true
🗝Token : String
Token to be used when using OAuth2.
Default: -
Example: cec4ce4f98e4f68e4vc89v1489v4987s4erv8794...
UserName : String
Use this username to log in to the SMTP server
Default: -
Example: testuser
🗝Password : String
Use this password to log in to the SMTP server
Default: -
Example: Password123
🗝ServerCertificationThumbprint : String
The SHA-1 thumbprint of the server's SSL certificate.
This provides a secure way to validate the server's identity without accepting all certificates.
How to obtain the thumbprint:
1. View the server's certificate in a browser
2. Open certificate details
3. Copy the SHA-1 fingerprint/thumbprint
Format: 40 hexadecimal characters (20 bytes)
Default: -
Example: a1b2c3d4e5f6g7h8i9j0...
Task Result
EmailSent : Boolean
Value is true if email was sent.
Example: true
StatusString : String
Contains information about the task's result.
Example: Email sent to: john.doe@somedomain.com
Task Changelog
Changelog for Task Frends.SMTP.SendEmail.
[2.1.0] - 2025-12-08
Fixed
Fix missing metadata about repository url and changelog.
[2.0.0] - 2024-09-30
Added
[Breaking] Added parameter AcceptAllCerts which allows bypassing SSL/TLS certificate validation for SMTP servers.
Default value: false
Warning: Enabling this option poses security risks. Only use when connecting to trusted SMTP servers with self-signed certificates.
Usage: Enable only in controlled environments where certificate validation issues cannot be resolved through proper certificate installation.
[Breaking] Added parameter ServerCertificationThumbprint which enables check for the certification thumbprint.
Default value: ""
[1.2.1] - 2024-01-02
Fixed
Fixed issue with connecting to SMTP servers which do not support authentication.
[1.2.0] - 2023-12-21
Changed
Changed Task to use MailKit library instead of deprecated System.Net.Mail.
Changed the Task to create a temp file from the AttachmentFromString. The temp file will be removed afterwards.
Added
Added OAuth2 support.
New parameters:
SecureSocket
UseOAuth2
Token
Removed
Removed UseWindowsAuthentication because it's not supported with the new library.
[1.1.0] - 2023-11-29
Fixed
[Breaking] Fixed issue with the attachments can't be given as expression by adding AttachmentOptions class.
[1.0.3] - 2023-11-03
Added
Fix missing XML comments.
[1.0.2] - 2023-11-03
Added
Fix bug #20 - Missing Frends tasks metadata file
[1.0.1] - 2023-05-15
Fixed
Fix bug #14 - NullReferenceException when field with 'Expression' type is empty
[1.0.0] - 2022-02-09
Added
Initial implementation
Last updated
Was this helpful?

