What is a MailMessage?

You are currently viewing What is a MailMessage?

Overview

A MailMessage is a data type that represents an email message that has been or could be received or sent. 

A MailMessage object does not just contain the body of the email, but majority of its properties such as the senders email address, the subject, any individuals copied, and even all the included attachments.

UiPath works with a whole plethora of mail providers including, but not limited to Exchange, IBM Notes, IMAP, Outlook, POP3, and SMTP.

There are three main functions in UiPath relating to MailMessages that are laid out as activities:

  • Get Mail Messages – Grabs emails from your desired email application and adds them to a list.
  • Move Mail Messages – Moves emails to a specified folder within your desired email application.
  • Send Mail Messages – Send an email designed in UiPath through your desired email application.

For even more functionality, you can use the below Methods or Properties to modify or retrieve information regarding the MailMessage object for processing.

What can you do with MailMessages?

Below are some great examples of the use of MailMessages:

  • Process Email Messages
  • Organize Mailboxes 
  • Filter Mail Messages

Commonly Used Properties

The following are some commonly used properties for MailMessages. A property is a characteristic or attribute of an object (i.e. MailMessage). To learn more about properties, click here

Attachments - Gets the collection of email attachments.

Example Property Example Return Return Type
MailMessage.Attachments
N/A
AttachmentCollection

Bcc - Gets the address collection of Bcc recipients.

Example Property Example Return Return Type
MailMessage.Bcc
{"Sam Smith"}
MailAddressCollection

Body - Gets or sets the message body.

Example Property Example Return Return Type
MailMessage.Body
"Dear Karen, "
String

BodyEncoding - Gets or sets the body encoding property.

Example Property Example Return Return Type
MailMessage.BodyEncoding
"us-ascii"
Encoding

CC - Gets the address collection of CC recipients.

Example Property Example Return Return Type
MailMessage.CC
{"Steve Smith","Kevin Roth"}
MailAddressCollection

From - Gets or sets the From address.

Example Property Example Return Return Type
MailMessage.From
"Clifford Frey"
MailAddress

IsBodyHTML - Gets a value indicating if the body is in HTML.

Example Property Example Return Return Type
MailMessage.IsBodyHTML
False
Boolean

Sender - Gets or sets the sender's email address as a String.

Example Property Example Return Return Type
MailMessage.Sender
"Clifford Frey"
String

Subject - Gets or sets the message subject.

Example Property Example Return Return Type
MailMessage.Subject
"Where is my Pizza?"
String

SubjectEncoding - Gets or sets the subject encoding property.

Example Property Example Return Return Type
MailMessage.SubjectEncoding
"us-ascii"
Encoding

To - Gets the address collection of To recipients.

Example Property Example Return Return Type
MailMessage.To
{"Karen Glory"}
MailAddressCollection

Commonly Used Methods

The following are some commonly used methods for MailMessages. Methods are actions that objects (i.e. MailMessage) can perform. To learn more about methods, click here

Dispose - Deletes a MailMessage.

Example Method Example Return Return Type
MailMessage.Dispose
N/A
N/A