Author Posts

September 20, 2016 at 7:50 pm

Hi,
Need help to add signature to email
my code:
$Outlook = New-Object -comObject Outlook.Application

$mail = $Outlook.CreateItem(0)
$mail.Subject = "TTT"
#$mailSign = Get-Content ($env:USERPROFILE + "\AppData\Roaming\Microsoft\Signatures\*.html")
$mail.Body = "Hi, "

$mail.Save()

$inspector = $mail.GetInspector
$inspector.Display()

September 20, 2016 at 9:30 pm

Struggled with that one, this worked for me.
Although is doesnt look very nice...

$text="hi guys"
$temp=$mail.body
$mail.htmlbody=get-content $env:appdata\Microsoft\Signatures\*.htm
$mail.body= $text +$mail.body + $temp

September 21, 2016 at 1:19 am

Thank you both,
and what about outlook template file .oft, how i can open it?
Thanks.

September 21, 2016 at 12:33 pm

just one more, how i can show signature image

Thanks.