如何从DOS批处理命令发送电子邮件? [英] How do I send an email from a DOS batch command?

查看:682
本文介绍了如何从DOS批处理命令发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在DOS中有一个批处理文件,做一些检查,我需要触发电子邮件时,它的完成。我在interwebz上找到了一些解决方案,但大多数是第三方或只是简单地在Outlook中打开一个新的消息。我需要命令发送一封电子邮件,没有任何人为的互动。



我们在这里使用MS Exchange,如果这很重要。



谢谢!

解决方案

假设:



<
  • 您的Exchange服务器通过端口25上的SMTP接受电子邮件。

  • 您希望仅发送不带附件的简单电子邮件。

  • 可以从批处理文件中驱动telnet(或类似的telnet客户端)。

  • 您只需发送一封简单的电子邮件Telnet。此链接显示了如何执行此操作的示例: http://www.yuki -onna.co.uk/email/smtp.html



    如果假设2或3错误,您可以写一个命令行SMTP客户端发送simples电子邮件很容易在许多语言,然后从您的批处理文件中调用它。


    I have a batch file in DOS that does some checking and I need to fire off an email when its done. I've found a few solutions on the interwebz but most of them are 3rd party or just simply open up a new message in Outlook. I need the command to send an email in its entirety without any human interaction.

    We use MS Exchange here, if that matters.

    Thanks!

    解决方案

    Assuming:

    1. Your Exchange server accepts emails via SMTP on port 25.
    2. You want to send a simple text only email without attachments.
    3. It's possible to drive telnet (or a similar telnet client) from a batch file.

    You could just send a simple email via Telnet. This link shows an example of how to do it: http://www.yuki-onna.co.uk/email/smtp.html

    If assumption 2 or 3 is wrong, you could write a command line SMTP client for sending simples emails fairly easily in many languages and then call it from your batch file.

    这篇关于如何从DOS批处理命令发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆