Sending e-mail in Windows via the mailsend console utility

Once I started using the mailsend program to automatically send reports via SMTP, since mailsend supports SSL. Before that I used Blat.

Official mailsend download page:
https://github.com/muquit/mailsend/releases/

I’ll give an example of my finished script, which can be saved with a file with the *.bat extension and added to autorun or run manually. The script sends the file to the specified addresses.

pause
K:\privat24\Send\mailsend1.18 -f user@example.com -smtp mx.example.com -domain mx.example.com -starttls -port 587 -auth -user user@example.com -pass PASSWORD -t "user2@example.com,mail3@example.com" -sub "Subject text" -ct 30 -read-timeout 30 -attach "K:\privat24\Out\PB.DBF" -log "K:\privat24\Send\mailsend_log.txt -q"
ECHO SENT!
pause
exit

I will describe the startup keys:

-copyright (view copyright information)
-4 (force the use of the IPv4 address of the SMTP server)
-6 (force the IPv6 address of the SMTP server)
-smtp (domain name or IP address of the SMTP server)
-port (SMTP port)
-domain (domain name for SMTP HELO / EHLO)
-t (address or addresses of recipients, separated by commas)
-cc (address or addresses of recipients, separated by commas, who will receive a copy)
-ct (connection timeout in seconds, standard 5)
-bc (address or addresses of recipients, separated by commas, who will receive a blind copy)
+D (do not add title with date)
-f (sender address)
-sub (theme)
-list_address FILE (address list file)
-log FILE (log file)
-cs ENCRYPTION (letter text encoding)
-attach FILE (file attachment)
-show-attach (display the attached file in debug mode, standard off)
-M “TEXT IN ONE LINE” (text of the letter in one line)
-msg-body FILE (path to the file with the message text)
-H “title” (adding a random title)
-name “NAME” (add the name text to the sender address)
-v (debug mode)
-V (view program version)
-w (expect CR after sending)
-rt ADDRESS (specify the address for the answer)
-rrr ADDRESS (request read notification)
-ssl (use SSL)
-starttls (use STARTTLS)
-auth (authentication order CRAM-MD5, LOGIN, PLAIN)
-auth-cram-md5 (use CRAM-MD5 authentication)
-auth-plain (use PLAIN authentication)
-auth-login (use LOGIN authentication)
-user NAME (login)
-pass PASSWORD (password)
-example (see examples of use)
-ehlo (forced EHLO)
-info (view SMTP server information)
-help (view help)
-q (display less information on the screen)

Everything is pretty simple.

Leave a comment

Leave a Reply