I use powershell to send emails from Outlook (complete automatic process). This work perfectly for the default mailbox. I have a lot of restrictions in the development network and can't use any software other than Outlook and powershell.
My question is: Is there a method to send email from a different account in outlook, using powershell (in my Outlook I have three accounts A, B and C), even if i have one of the as predetermined.
The code that I use is this.
$o = New-Object -com Outlook.Application
$mail = $o.CreateItem(0)
$mail.importance = 2
$mail.subject = "SUBJECT"
$mail.body = "BODY"
$mail.To = "[email protected];"
$mail.Send()
Is there a property I can set to make the email origin to be B or C, and not the predetermined A.