I am attempting to automate the sending of an email when I run a batch script (a Notepad .bat file) in Windows 11. I have done this in the distant past and assumed that it would still work in Win 11, but I seem to be having trouble. I had a more complex script, but for the sake of troubleshooting, I’ve distilled it down to the following simple code:
@echo off
ipm add message /t "[email protected]" /s "[email protected]"
ipm.send
I have also tried:
set outlookApp = CreateObject("Outlook.Application")
set mailItem = outlookApp.CreateItem(0)
mailItem.To = "[email protected]"
mailItem.Subject = "Your Email Subject"
mailItem.Body = "Your Email Body"
mailItem.Send
Neither seem to work, though both Gemini AI and Copilot seem to feel that they both should. Finally, I tested to see if batch scripts worked at all anymore and was able to get Outlook to open and generate a new message window with the following:
start outlook.exe /c ipm.note
I wasn’t able to get it to set any of the field values or to send procedurally from there though.
I know that I can use Powershell for this, but I’m not familiar with it and honestly it seems like it would be overkill. Does anyone know what I might be doing wrong with my scripts?
3