2015-02-23 63 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% 
相关问题