First introduce the next SendMail
About SendEmail
SendEmail is a lightweight, command line SMTP email client. If you had the need to send mail from a command line, this free program was perfect:simple to use and feature rich. It was designed to being used in bash scripts, batch files, Perl programs and Web sites, but is quite adaptable and would like Ly meet your requirements. SendEmail are written in Perl and are unique in that it requires NO MODULES. It has a intuitive and flexible set of command-line options, making it very easy-to-learn and use.
[Supported Platforms:linux, BSD, OS X, Windows 98, Windows NT, Windows $, & Windows XP]
http://caspian.dotconf.net/menu/Software/SendEmail/
You can use the command-line tool after downloading the extract. Or:
Installation method:
1) Extract the package
TAR-ZXVF sendemail-v1.xx.tar.gz
2) Copy the SendEmail script To/usr/local/bin
Cp-a Sendemail-v1.xx/sendemail/usr/local/bin
3) Make sure its executable
chmod +x/usr/local/bin/sendemail
4) Run It
SendEmail
Or
/usr/local/bin/sendemail
Some of the parameters are as follows:
-F denotes from, sender address
-T denotes to, recipient address
-S mail server domain name
-U Theme
-xu User name (before @)
-XP User Password
-M Plain Text information
-O message-file=/root/. Send content from a file
-A Send attachment (-m,-o,-a can be used simultaneously)
For example:
[Email protected] sendemail-v1.56]#/sendemail-f [email protected]-t [email protected]-s SMTP.163.COM-XU aaaa-xp PA Ssword-u test-m Testeamil
APR 10:09:16 Blog sendemail[8861]: Email was sent successfully!
Problem:
1 · If the following prompt appears
Jan 10:06:15 ora01 sendemail[8704]: ERROR = Connection attempt to localhost:25 Failed:io::socket::inet:connect:c Onnection refused
is a mail server domain name that does not specify the-s parameter.
Shell Script monitoring:
Http://blog.chinaunix.net/uid-7589639-id-3018209.html
Most mail services have SMS Notification Services, such as Sina 50 free short credits per month, for individuals, enough.
Linux master-Slave synchronization monitor and use SendMail to send mail