Possible to send email with 'high importance'?

Post Reply
vino1493
Posts: 30
Joined: Tue Mar 14, 2017 12:01 pm
OLAP Product: cognos tm1
Version: 10.2.2
Excel Version: excel 2013

Possible to send email with 'high importance'?

Post by vino1493 »

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: 3113
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:

Re: Possible to send email with 'high importance'?

Post by Wim Gielis »

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

Re: Possible to send email with 'high importance'?

Post by vino1493 »

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
Post Reply