Working with e-mail
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 e-mail objects that the API currently has.
Getting ready
Unsurprisingly, we need an e-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 e-mail server.
For this recipe, we will use IMAP and SMTP to connect to the e-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 e-mail: the MailClient
object and the EmailMessage
object. We will use EmailMessage
to send messages and MailClient
to receive e-mail.
How to do it...
We will break this recipe down into configuration and sending/receiving...