2017年3月7日 星期二

Send Emails From The Windows Task Scheduler

How To Easily Send Emails From The Windows Task Scheduler

ask Scheduler doesn’t support authentication, so you can’t provide a username and password for your SMTP server -> Using SendEmail No TLS 

-f you@gmail.com -t person@example.com -u Subject -m This is the body text! -s smtp.gmail.com:587 -xu you@gmail.com -xp password -o tls=yes                           


windows scheduler to run a task every x-minutes?
:loop
CallYour.Exe
timeout /t timeToWaitBetweenCallsInSeconds /nobreak
goto :loop
http://www.splinterware.com/download/index.html
when install email relay on Windows 7 , http://www.wikihow.com/Open-Port-25
emailrelay --help --verbose


E-MailRelay V1.9

usage: emailrelay [-QAdjbegxfhHmlLtXnRBJGrkvV] [--admin=<admin-port>]
  [--admin-terminate] [--anonymous] [--as-client=<host:port>]
  [--as-proxy=<host:port>] [--as-server] [--client-auth=<file>]
  [--client-filter=<program>] [--client-tls] [--client-tls-connection]
  [--close-stderr] [--connection-timeout=<time>] [--debug] [--domain=<fqdn>]
  [--dont-serve] [--filter=<program>] [--filter-timeout=<time>] [--forward]
  [--forward-to=<host:port>] [--help] [--hidden] [--immediate]
  [--interface=<ip-list>] [--log] [--log-file=<file>] [--log-time]
  [--no-daemon] [--no-smtp] [--no-syslog] [--peer-lookup]
  [--pid-file=<pid-file>] [--poll=<period>] [--pop] [--pop-auth=<file>]
  [--pop-by-name] [--pop-no-delete] [--pop-port=<port>] [--port=<port>]
  [--prompt-timeout=<time>] [--remote-clients] [--response-timeout=<time>]
  [--server-auth=<file>] [--server-tls=<pem-file>] [--size=<bytes>]
  [--spool-dir=<dir>] [--syslog] [--tls-config=<flags>] [--verbose]
  [--verifier=<program>] [--version]

  -a, --admin=<admin-port>        enables the administration interface and
                                  specifies its listening port number
  -Q, --admin-terminate           enables the terminate command on the admin
                                  interface
  -A, --anonymous                 disables the smtp vrfy command and sends less
                                  verbose smtp responses
  -q, --as-client=<host:port>     runs as a client, forwarding all spooled mail
                                  to <host>: equivalent to "--log --no-syslog
                                  --no-daemon --dont-serve --forward
                                  --forward-to"
  -y, --as-proxy=<host:port>      runs as a proxy server, forwarding each mail
                                  immediately to <host>: equivalent to "--log
                                  --close-stderr --poll=0 --forward-to"
  -d, --as-server                 runs as a server, storing mail in the spool
                                  directory: equivalent to "--log
                                  --close-stderr"
  -C, --client-auth=<file>        enables smtp authentication with the remote
                                  server, using the given secrets file
  -Y, --client-filter=<program>   specifies an external program to process
                                  messages when they are forwarded
  -j, --client-tls                enables negotiated tls/ssl for smtp client
                                  (if openssl built in)
  -b, --client-tls-connection     enables smtp over tls/ssl for smtp client (if
                                  openssl built in)
  -e, --close-stderr              closes the standard error stream soon after
                                  start-up
  -U, --connection-timeout=<time> sets the timeout (in seconds) when connecting
                                  to a remote server (default is 40)
  -g, --debug                     generates debug-level logging if built in
  -D, --domain=<fqdn>             sets an override for the host's fully
                                  qualified domain name
  -x, --dont-serve                disables acting as a server on any port (part
                                  of --as-client and usually used with
                                  --forward)
  -z, --filter=<program>          specifies an external program to process
                                  messages as they are stored
  -W, --filter-timeout=<time>     sets the timeout (in seconds) for running the
                                  --filter processor (default is 300)
  -f, --forward                   forwards stored mail on startup (requires
                                  --forward-to)
  -o, --forward-to=<host:port>    specifies the remote smtp server (required by
                                  --forward, --poll, --immediate and --admin)
  -h, --help                      displays help text and exits
  -H, --hidden                    hides the application window and suppresses
                                  message boxes (requires --no-daemon)
  -m, --immediate                 enables immediate forwarding of messages as
                                  soon as they are received (requires
                                  --forward-to)
  -I, --interface=<ip-list>       defines the listening interface(s) for
                                  incoming connections (comma-separated list
                                  with optional smtp=,pop=,admin= qualifiers)
  -l, --log                       writes log information on stderr and to the
                                  event log (but see --close-stderr and
                                  --no-syslog)
  -N, --log-file=<file>           log to file instead of stderr (%d replaced by
                                  the date)
  -L, --log-time                  adds a timestamp to the logging output
  -t, --no-daemon                 uses an ordinary window, not the system tray
  -X, --no-smtp                   disables listening for smtp connections
                                  (usually used with --admin or --pop)
  -n, --no-syslog                 disables use of the system event log
  -R, --peer-lookup               lookup the account names of local peers to
                                  put in the envelope files
  -i, --pid-file=<pid-file>       defines a file for storing the daemon
                                  process-id
  -O, --poll=<period>             enables polling of the spool directory for
                                  messages to be forwarded with the specified
                                  period (zero means on client disconnection)
                                  (requires --forward-to)
  -B, --pop                       enables the pop server
  -F, --pop-auth=<file>           defines the pop server secrets file (default
                                  is "C:\Windows\emailrelay.auth")
  -J, --pop-by-name               modifies the pop spool directory according to
                                  the pop user name (requires --pop)
  -G, --pop-no-delete             disables message deletion via pop (requires
                                  --pop)
  -E, --pop-port=<port>           specifies the pop listening port number
                                  (default is 110) (requires --pop)
  -p, --port=<port>               specifies the smtp listening port number
                                  (default is 25)
  -w, --prompt-timeout=<time>     sets the timeout (in seconds) for getting an
                                  initial prompt from the server (default is
                                  20)
  -r, --remote-clients            allows remote clients to connect
  -T, --response-timeout=<time>   sets the response timeout (in seconds) when
                                  talking to a remote server (default is 1800)
  -S, --server-auth=<file>        enables authentication of remote clients,
                                  using the given secrets file
  -K, --server-tls=<pem-file>     enables negotiated tls/ssl for smtp server
                                  using the given openssl certificate file
                                  (which must be in the directory trusted by
                                  openssl)
  -M, --size=<bytes>              limits the size of submitted messages
  -s, --spool-dir=<dir>           specifies the spool directory (default is
                                  "C:\Windows\system32\spool\emailrelay")
  -k, --syslog                    forces system event log output if logging is
                                  enabled (overrides --no-syslog)
  -9, --tls-config=<flags>        sets tls configuration flags (eg. 2 for
                                  SSLv2/3 support)
  -v, --verbose                   generates more verbose output (works with
                                  --help and --log)
  -Z, --verifier=<program>        specifies an external program for address
                                  verification
  -V, --version                   displays version information and exits

To start a 'storage' daemon in background...
   emailrelay --as-server

To forward stored mail to "mail.myisp.net"...
   emailrelay --as-client mail.myisp.net:smtp

To run as a proxy (on port 10025) to a local server (on port 25)...
   emailrelay --port 10025 --as-proxy localhost:25

Copyright (C) 2001-2013 Graeme Walker


沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。