【问题标题】:How can I send an email from the command line using blat when the body contains carriage returns and line feeds?当正文包含回车和换行时,如何使用 blat 从命令行发送电子邮件?
【发布时间】:2016-03-30 02:03:06
【问题描述】:

我有一个 Windows 服务器,它通过 BASIC 程序向我发送电子邮件。如果邮件正文包含回车/换行,则电子邮件永远不会结束。只有第一行发送给我。我尝试用 \n 替换它们,但这并没有帮助,因为电子邮件中带有 \n 。有什么想法吗?

这是我正在使用的命令:

blat -to mike.roosa@toltsg.com -subject "[DEV] PO Detail Report" -body "Attached file
is ready for import.
From 01/01/09 to 01/29/09 
PO Status not egual to 'C'" -attach "C:\TXT\PODetail_26879.csv" -log
C:\EMAIL.LOG\20090129.TXT -timestamp'.

【问题讨论】:

    标签: windows email smtp blat


    【解决方案1】:

    如果您想内联,请使用“|”字符

    -body 1st line|second line|third line
    

    【讨论】:

      【解决方案2】:

      您可以将正文放在一个文本文件中并让 blat 发送:

      blat [text file here] -to mike.roosa@toltsg.com -subject "[DEV] PO Detail Report" -attach "C:\TXT\PODetail_26879.csv" -log
      C:\EMAIL.LOG\20090129.TXT -timestamp'
      

      【讨论】:

        【解决方案3】:

        只需使用 Mail Alert Simple Mailer: https://sourceforge.net/projects/mail-alert/

        MailAlert.exe -r 地址@example.com -b "@Your_Directory\File_with_Mail_Body.txt"

        您还可以将 HTML 文件作为电子邮件正文附加(请记住在这种情况下更改 PlaintextOnly=no)。

        【讨论】:

          猜你喜欢
          • 2010-09-07
          • 2023-03-10
          • 2015-01-24
          • 2010-09-20
          • 2011-02-05
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多