как послать электронное письмо от пакетного файла окон?

Как я могу послать электронное письмо от пакетного файла Windows или иначе получить уведомление об успешности или неуспешности пакетного файла?

2
задан 05.01.2010, 21:32

3 ответа

Мне нравится, блеют для почты командной строки.

Существует множество механизмов уведомления, ограниченных Вашей средой и Вашим воображением. Другое мое избранное net send (действительно будьте осторожны с этим...), и Твиттер (различные инструменты командной строки там).

2
ответ дан 11.12.2019, 22:43

Можно использовать bmail.

C:\>bmail /?

    Command Line SMTP Emailer V1.07
    Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org
    Usage: bmail [options]
         -s    SMTP Server Name
         -p    SMTP Port Number (optional, defaults to 25)
         -t    To: Address
         -f    From: Address
         -b    Text Body of Message (optional)
         -h    Generate Headers
         -a    Subject (optional)
         -m    Filename (optional) Use file as Body of Message
         -c    Prefix above file with CR/LF to separate body from header
         -d    Debug (Show all mail server communications)

использование -d (отладка) Вы видите если отправка сообщения, за которым следуют или нет.

0
ответ дан 11.12.2019, 22:43

Править: Я не знаком с выполнением команд Cygwin от пакетного файла, я видел ссылку на него в другом месте. В зависимости от Вашего опыта с Cygwin, одним из других ответов, возможно, больше подходящее для Ваших потребностей, но я оставлю этого здесь для потомства.


Если Вы уже установили Cygwin, можно установить email пакет.

$ email --help
Options information is as follows
email [options] recipient1,recipient2,...

    -h, -help module          Print this message or specify one of the below options
    -V, -verbose              Display mailing progress.
    -f, -from-addr            Senders mail address
    -n, -from-name            Senders name
    -b, -blank-mail           Allows you to send a blank email
    -e, -encrypt              Encrypt the e-mail for first recipient before sending
    -s, -subject subject      Subject of message
    -r, -smtp-server server   Specify a temporary SMTP server for sending
    -p, -smtp-port port       Specify the SMTP port to connect to
    -a, -attach file          Attach file and base64 encode
    -c, -conf-file file       Path to non-default configuration file
    -t, -check-config         Simply parse the email.conf file for errors
    -x, -timeout              Set socket timeout.
        -cc email,email,...   Copy recipients
        -bcc email,email,...  Blind Copy recipients
        -sign                 Sign the email with GPG
        -html                 Send message in HTML format ( Make your own HTML! )
        -tls                  Use TLS/SSL
    -m, -smtp-auth type       Set the SMTP AUTH type (plain or login)
    -u, -smtp-user username   Specify your username for SMTP AUTH
    -i, -smtp-pass password   Specify your password for SMTP AUTH
    -g, -gpg-pass             Specify your password for GPG
    -H, -header string        Add header (can be used multiple times)
        -high-priority        Send the email with high priority
        -no-encoding          Don't use UTF-8 encoding
0
ответ дан 11.12.2019, 22:43

Теги

Похожие вопросы