Working with mails
In this recipe, we will learn how to interact with e-mails and discuss configuring, sending, and receiving e-mails with Orchestrator. We will discuss both mail objects that the API currently has.
Getting ready
Unsurprisingly, we need a mail server. If you don't have one handy, you can use hmailServer for Windows; refer to the There's more... section of this recipe to learn how to install and configure this free, open source mail server.
For this recipe, we will use IMAP and SMTP to connect to the mail server. In the How it works... section, we also take a quick look at POP3 and SSL. We will also need two e-mail addresses. In our example, we will use vcotest@mylab.local
and vcotest2@mylab.local
.
There are two API Objects that can be used when working with mails: the MailClient
object and the EmailMessage
object. We will use EmailMessage
to send messages and MailClient
to receive mails.
How to do it...
We will break this recipe down into configuration and sending and...