Microsoft Exchange Server 2016 PowerShell Cookbook - Fourth Edition
by Jonas Andersson, Nuno Mota, Mike Pfeiffer
How it works...
When we send email messages through EWS, we don't have to worry about specifying an SMTP server since the message is transmitted through the web service. This allows our code to run on any machine that has PowerShell installed, and we don't need to modify the receive connectors on the client access servers to allow a specific host to relay mail. Additionally, EWS will allow us to use AutoDiscover to automatically find the correct endpoint, which prevents the need to hardcode server names into our scripts.
Setting the Subject, Body, and From properties of an EmailMessage object is pretty straightforward. We simply need to assign a value as we would with any other object. Adding recipients requires that we use the Add method ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access