Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
向通过Windows命令行发送的电子邮件添加多个附件_Windows_Email_Batch File_Command Line_Email Attachments - Fatal编程技术网

向通过Windows命令行发送的电子邮件添加多个附件

向通过Windows命令行发送的电子邮件添加多个附件,windows,email,batch-file,command-line,email-attachments,Windows,Email,Batch File,Command Line,Email Attachments,有办法做到这一点吗?我可以轻松添加多个电子邮件收件人,但无法以任何类似的方式指定多个附件 我当前使用的代码格式是: “[…]\outlook.exe”/a“[…].txt”/m”[recipient1];[recipient2]&主题=[subject]&正文=[body]” 为了添加第二个附件,我尝试了添加分号、逗号、删除引号并只列出文件路径、在引号中添加第二个文件路径等等,但都没有成功。可以这样做吗?您可以从命令行或.bat文件发送多个附件 powershell send-mailmessa

有办法做到这一点吗?我可以轻松添加多个电子邮件收件人,但无法以任何类似的方式指定多个附件

我当前使用的代码格式是:

“[…]\outlook.exe”/a“[…].txt”/m”[recipient1];[recipient2]&主题=[subject]&正文=[body]”


为了添加第二个附件,我尝试了添加分号、逗号、删除引号并只列出文件路径、在引号中添加第二个文件路径等等,但都没有成功。可以这样做吗?

您可以从命令行或.bat文件发送多个附件

powershell send-mailmessage -to 'pwatson@dom.org' -from 'pwatson@dom.org' ^
  -subject 'Multiple email attachments' ^
  -SmtpServer 'mail.dom.org' ^
  -attachment f1.txt, f2.txt, f3.txt

您是否尝试过简单地添加多个
/a
开关,即
/a att1.txt/a att2.txt/a att3.txt…