I have this code which works.
$Outlook=New-Object-ComObjectOutlook.Application
$Mail=$Outlook.CreateItem(0)
$Mail.To="MyEMailAddress@Acme.org"
$Mail.From="ITinsider@Acme.Org"
$Mail.Subject="IT Department: Action Required"
$Mail.Body="Message from IT Department: You have not rebooted for you system for over 1 week. Please reboot your system today. This is required for virus protection. Thank you!"
$Mail.Send()
When I run this code the email does show up. But I get this error at the bottom half of my PowerShell ISE window.
Exception setting "From": "The property 'From' cannot be found on this object. Verify that the property exists and can be set."
If there is no .From method how come it still works? And if there is no .From method what should I use to make this work and not generate the error I get? How do I make this email come from someone else? I need it to come from ITInsider@Acme.org.