I’m using the code below to send mail from PowerShell through Outlook. $olMailItem = 0 $olApp = new-object -comobject outlook.application $NewMail = $olApp .CreateItem( $olMailItem ) $NewMail .Subject = " PowerShell Test e-mail " $NewMail .To = " Jason@MCTExpert.com " $NewMail .Body = " Have a nice day " $NewMail .SentOnBehalfOfName = " PleaseWork@MCTExpert.com " $NewMail .Send() The problem was that the reply address was mine. I needed to change this so I did a little bit of research. I changed the final line of the script to $olMailItem = 0 $olApp = new-object -comobject outlook.application $NewMail = $olApp .CreateItem( $olMailItem ) $NewMail .Subject = " PowerShell Test e-mail " $NewMail .To = " Jason@MCTExpert.com " $NewMail .Body = " Have a nice day " $NewMail | Get-Member This get me the following results. Take a look at the highligh
Welcome to the blogsite of MCTExpert. I am a Microsoft Certified Trainer. Here you will find the real questions that are asked to me by my students.