在Cygwin中使用"email"命令

sno*_*916 3 email command-line cygwin

我正在尝试使用Cygwin从命令行发送电子邮件.这就是我所说的:

email -f myaddress@blah.com -s "This is a test" -b toaddress@blah.com
Run Code Online (Sandbox Code Playgroud)

我收到此错误消息:

/bin/sh: /usr/lib/sendmail: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我在/ usr/lib中创建了一个名为"sendmail"的文件夹,现在我得到了这个:

/bin/sh: /usr/lib/sendmail: is a directory
Run Code Online (Sandbox Code Playgroud)

有人可以给我一步一步说明如何从Cygwin发送电子邮件吗?喜欢如何设置它和一切?我到处寻找,我准备把头发撕掉了.

编辑:感谢您的回复.这就是我最终让它发挥作用的方式.

bash.exe -c "echo  -e 'To: thepeopleimsendingitto@blah.com\nSubject: mySQL Upload\nSQL files from machines uploaded to log table successfully.' | sendmail -f me@blah.com otherpeople@blah.com"
Run Code Online (Sandbox Code Playgroud)

即使Cygwin在我的Windows路径中,也无法识别它,所以我必须直接运行bash.exe并说"将此命令作为Linux命令".回声就是构建电子邮件本身的内容.\n字符将其分为"To","Subject"和Body.

rei*_*ost 6

显然,email是一个程序,它允许您提交依赖于另一个程序来实际发送邮件(邮件传输代理)的电子邮件(邮件提交代理).

我上周在Cygwin上安装了这个.我没有使用,emailmuttCygwin提供的替代品之一(参见其包装清单).我mutt不仅用来提交要发送的邮件,还要用来阅读它; 它是一个邮件用户代理(参见一些截图).

喜欢email,mutt依靠邮件传输代理来发送邮件,所以我不得不安装一个.在Linux上,流行的选择是sendmailpostfix; 但他们所做的远远超过你的需要,而且Cygwin没有将它们作为包装提供.它确实提供eximssmtp.

我安装了ssmtp包并运行了该ssmtp-config实用程序.你必须在这里做出一些决定.您必须知道可以使用哪个SMTP服务器,以及是否需要任何特殊配置才能与之通信.

顺便说一句,ssmtp是否安装了一个名为的可执行文件sendmail,它不是原始版本sendmail,但是出于您需要的目的而表现得像.