emailbatch-fileblat

How to set email body content using string variable in blat.exe?


when I call below line of code in my batch file it successfully sends an email with email body content available in success_msg.txt.

C:\\MyPath\\blat.exe C:\\MyPath\\success_msg.txt -subject "This is Subject Line" -to user@abc.com

Is there any way to send a string variable in place of path of the content file?


Solution

  • "C:\MyPath\blat.exe" -body "Body text inline" -subject "This is Subject Line" -to user@abc.com
    

    worked for me. The documentation appears to say that -body should itself be preceded by - and also appears to require the body-text to be the first parameter.

    I found that the - before -body was not required, but did not test with the in-line body-text in any other position. YMMV.

    I altered and quoted the executable-string. Doubling the \ does nothing, and it must be quoted if the string contains spaces. (actually, blat.exe is located on my path, so the absolute-filename for the executable is not required, only blat)

    The quoted-bodytext could be replaced by a variablename if desired, in the form "%mybodytext%"

    My version : v3.2.16 (build : Aug 7 2016 22:51:52)