2015-02-23 35 views
2

我一直在嘗試使用批處理/ blat.exe發送電子郵件 發送電子郵件是容易的部分;棘手的部分是發送身體作爲Html消息。Html電子郵件正文使用批處理和Blat.exe

Set EmailBody="htmlPath\file.html" 
    set to=-to [email protected] 
    set f=-f [email protected] 
    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% 

我使用的HTML文件很簡單:

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

沒有太多的BLAT周圍,我已經看到了幾個例子不是爲我工作。任何人都可以告訴我我做錯了什麼?

任何幫助非常感謝。

+0

我現在明白了......下面的答案。 – ricky89 2015-02-23 17:10:45

回答

1

我認爲這個問題只是最後一行中的' - '。完成了這一步,它開始按預期工作。

Set EmailBody="htmlPath\file.html" 
     set to=-to [email protected] 
     set f=-f [email protected] 
     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%