Hey guys.

I'm using this code to generate automated e-mail-messages embedded in a bigger script:

 Code:
$rc = SetOption("NoMacrosInStrings","On")

$Root = CreateObject("Outlook.Application")
$MailItem = $Root.CreateItem(0)
$MailItem.Importance = 1
; - 2 high importance
; - 1 normal importance
; - 0 low importance
$MailItem.Subject = "Test"
$MailItem.Sender = "from@test.com"
$MailItem.To = "rcpt@test.com"
$MailItem.Body = "Test body text"
$MailItem.Send
$Root = 0


Working flawlessly, but I'm struggling with the sender-part. I'm running this script as a scheduled task on my comp, but want another e-mail-address as the reply-address.

Obviously outlok uses the users configured account as default sender, and I do not accomplish to change this in the script. I have even tried using sender accounts which I have full access to... but still no luck.

Any suggestions?


Edited by Curious (2016-02-16 11:08 AM)
_________________________
I was placed on earth to do a job. Right now I have so much to do, I will never die..