我安裝了 cygwin 和這個包:https ://cygwin.com/packages/x86_64/email/email-3.2.1-git-1
您知道如何在 Windows 10 中使用 cygwin 電子郵件包創建 bat 檔案并發送帶附件的電子郵件嗎?
uj5u.com熱心網友回復:
Powershell內置在你的windows設備中,powershell 2.0up有這個Send-MailMessage功能。如果你真的需要使用batch-file這個任務,你可以簡單地powershell從 a中呼叫batch-file:
@echo off
powershell Send-MailMessage -From '[email protected]' -To '[email protected]' -Subject 'Test email' -Body 'This is a test' -SmtpServer mailserver.domain.com -Attachments 'C:\Some Dir\Somefile.txt'
在 Stackoverlow 上將其分解為可讀的形式:
powershell Send-MailMessage
-From '[email protected]'
-To '[email protected]'
-Subject 'Test email'
-Body 'This is a test'
-SmtpServer mailserver.domain.com
-Attachments 'C:\Some Dir\Somefile.txt'
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/461049.html
