Page 1 of 1

Possible to send email with 'high importance'?

Posted: Thu Mar 29, 2018 9:27 am
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 );

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

Posted: Thu Mar 29, 2018 9:45 am
by Wim Gielis
Please use Google:

powershell send-mailmessage high priority

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

Posted: Thu Mar 29, 2018 11:01 am
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