Free for PREMIUM members
Go Premium for a chance to win a PS4. Enter to Win
Const olMailItem = 0
Dim olkApp, olkSes, olkMsg
On Error Resume Next
Set olkApp = GetObject(, "Outlook.Application")
On Error GoTo 0
If TypeName(olkApp) = "Nothing" Then
Set olkApp = CreateObject("Outlook.Application")
Set olkSes = olkApp.GetNamespace("MAPI")
'Change the Outlook profile name on the next line as needed'
Set olkMsg = olkApp.CreateItem(olMailItem)
'Change the address ont eh next line'
'Change the subject on the next line'
.Subject = "My Subject"
'Change the message body on the next line'
.Body = "Some text."
Set olkMsg = Nothing
Set olkSes = Nothing
Set olkApp = Nothing
Open in new window
Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!