vino1493
Posts: 30 Joined: Tue Mar 14, 2017 12:01 pm
OLAP Product: cognos tm1
Version: 10.2.2
Excel Version: excel 2013
Post
by vino1493 » Thu Mar 29, 2018 9:27 am
I have the below code for sending email notification, but would like to send that with high importance.
Is it possible?
Code: Select all
sSubject = 'WD-' | vDay | ' load completed ' ;
sBody = '
<body>
Hi All,
<br>
<br>
</body>' | 'load started ';
# build powershell command
sPsCmd = '"& {
Send-MailMessage
-From ' | sFrom | '
-To ' | sTo | '
-cc ' | sCC | '
-Subject ' | '\"' | sSubject | '\"
-Body ' | '\"' | sBody | '\"
-BodyAsHtml -SmtpServer ' | sSmtpServer | '
}"';
# execute command
ExecuteCommand ( 'powershell.exe -command ' | sPsCmd, 1 );
Last edited by
vino1493 on Thu Feb 21, 2019 5:08 pm, edited 1 time in total.
Wim Gielis
MVP
Posts: 3118 Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:
Post
by Wim Gielis » Thu Mar 29, 2018 9:45 am
Please use Google:
powershell send-mailmessage high priority
Best regards,
Wim Gielis
IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==>
121 TM1 articles and a lot of custom code
Newest blog article:
Deleting elements quickly
vino1493
Posts: 30 Joined: Tue Mar 14, 2017 12:01 pm
OLAP Product: cognos tm1
Version: 10.2.2
Excel Version: excel 2013
Post
by vino1493 » Thu Mar 29, 2018 11:01 am
Code: Select all
sPriority = 'High';
# build powershell command
sPsCmd = '"& {
Send-MailMessage
-From ' | sFrom | '
-To ' | sTo | '
-cc ' | sCC | '
-Subject ' | '\"' | sSubject | '\"
-Body ' | '\"' | sBody | '\"
-BodyAsHtml
-Priority ' | sPriority | '
-SmtpServer ' | sSmtpServer | '
}"';
That did the trick