Discussion:
Blat saw and processed these options, and was confused by the last one
(too old to reply)
Anji Mannam mannamanji@yahoo.com [blat]
2016-11-02 06:33:31 UTC
Permalink
Hi Blat Group,
We are calling with the below script to send email notification.if %msg% has Double quotes in the message it is fialing and throwing an error like below.
Blat saw and processed these options, and was confused by the last one
 smail.exe "email" -t "%mc_email_recipients%" -s "%severity% alert on %mc_host%" -body "Severity=%severity%|Status=%status%|Message=%msg%|Address=%mc_host_address%|Parameter=%mc_parameter%|Object=%mc_object%|Owner=%mc_object_owner%|Parameter_Value=%mc_parameter_value%" -log "D:\Emaillog\%mc_host%.log" -timestamp


Blat v3.2.16 (build : Aug  7 2016 22:51:22)
32-bit Windows, Full, Unicode
Blat saw and processed these options, and was confused by the last one...


    -t ***@test.com
    -s CRITICAL alert on test81
    -body Severity=CRITICAL|Status=OPEN|Message=test81.:[2016-10-31
    15:05:02.141]
Do not understand argument: 15:05:02.141]

Windows console utility to send mail via SMTP or post to usenet via NNTP
by P.Mendes,M.Neal,G.Vollant,T.Charron,T.Musson,H.Pesonen,A.Donchey,C.Hyde
  happy mailing : Blat online

|
|
|
| | |


|


|
|
| |
happy mailing : Blat online
By Tim Musson Blat - A Win32 Command Line mailer | |


|


|







Regards, Anji
'Chip' chip.programmer@att.net [blat]
2016-11-04 05:33:02 UTC
Permalink
Post by Anji Mannam ***@yahoo.com [blat]
Hi Blat Group,
We are calling with the below script to send email notification. If %msg%
has Double quotes in the message it is failing and throwing an error like
below.
Blat saw and processed these options, and was confused by the last one
smail.exe "email" -t "%mc_email_recipients%" -s "%severity% alert on
%mc_host%" -body
"Severity=%severity%|Status=%status%|Message=%msg%|Address=%mc_host_address%|Parameter=%mc_parameter%|Object=%mc_object%|Owner=%mc_object_owner%|Parameter_Value=%mc_parameter_value%"
-log "D:\Emaillog\%mc_host%.log" -timestamp
Blat v3.2.16 (build : Aug 7 2016 22:51:22)
32-bit Windows, Full, Unicode
Blat saw and processed these options, and was confused by the last one...
-s CRITICAL alert on test81
-body Severity=CRITICAL|Status=OPEN|Message=test81.:[2016-10-31
15:05:02.141]
Do not understand argument: 15:05:02.141]
This happens because you used quotation marks inside your environment
variables rather than on the outside of your environment variables.

For example:
set msg="This is a message line with quotation marks."

The above line should actually have been this:
set "msg=This is a message line with quotation marks."

Having the quotation marks around the whole environment variable and data
allows the Windows command parser to pass the environment variable to Blat
without the embedded quotation marks. Blat would then see the "Severity..."
as one value.

Chip

Continue reading on narkive:
Loading...