3

I have been playing around with trying to send an email using batch/blat.exe Sending the email is the easy part; the tricky part is sending the body as a Html message.

    Set EmailBody="htmlPath\file.html"
    set to=-to to@Email.com
    set f=-f from@Email.com
    set server=-server mail.Server1.com
    set subject=-subject "Subject of Email"
    set password=-pw password
    set username=-u username

    :: Send the email
    Path\Blat.exe - %EmailBody% %to% %f% %subject% %server% %username% %password%

The html file I am using is simply:

<p>This is a Test</p><br/>with a second line

There isn't much on Blat around and the few examples I have seen aren't working for me. Can anyone show me what I'm doing wrong?

Any help greatly appreciated.

ricky89
  • 1,326
  • 6
  • 24
  • 37

2 Answers2

1

I think the issue was simply the '-' in the final line. Took that out and it started it work as expected.

 Set EmailBody="htmlPath\file.html"
        set to=-to to@Email.com
        set f=-f from@Email.com
        set server=-server mail.Server1.com
        set subject=-subject "Subject of Email"
        set password=-pw password
        set username=-u username

        :: Send the email
        Path\Blat.exe %EmailBody% %to% %f% %subject% %server% %username% %password%
ricky89
  • 1,326
  • 6
  • 24
  • 37
-1

Use Mail Alert Simple Mailer: https://sourceforge.net/projects/mail-alert/

You can add mail body from HTML file or attach it as an attachment.

Furthermore, it supports SSL/TLS servers like gmail, etc.

Admin
  • 29
  • 1