Linux Automatically send mail

Source: Internet
Author: User
Tags auth svn

Background: The company needs to be operational within the working days of the test department to send an e-mail to notify SVN version number and to test, daily manual hair too annoying, pure manual repetition of the work of no benefit, it comes from moving it. Linux Automatic email is also available in Zabbix monitoring notifications.

Key points: CENTOS7,SVN version number acquisition, email tool and settings, timed execution crontab.

One, SVN version number gets:
    • Command: SVN info URL

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/8B/E6/ Wkiol1hb39wgxfrdaabasu3ynr0122.png "" 708 "height=" 217 "/>

After getting the latest version information, you can get the SVN version number with some combination commands.

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/8B/E9/ Wkiom1hb39bifaifaaatrihcbxk113.png "" 1078 "height="/>

Second, e-mail:
    • Tools: Yum Installation, mailx-12.5-12.el7_0.x86_64,postfix-2.10.1-6.el7.x86_64,sendmail-8.14.7-4.el7.x86_64, General CentOS 7 comes with it.

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/8B/E9/ Wkiom1hb392rd2vsaaavacmmglw811.png "" 489 "height=" 216 "/>

    • Mail Service settings:

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; margin:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/8B/E9/ Wkiom1hb3-cifhb1aaa1azgenri198.png "" 381 "height=" 291 "/>

Open the Mail.rc file and add the following information in the optimal order:

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; margin:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/8B/E6/ Wkiol1hb3-gw8ghvaaailfe2hjq435.png "" 490 "height=" 216 "/>

Mail send message to modify the/etc/mail.rc script file, set the sender address, SMTP server, sender mailbox name, password,

Set [email protected]

Set smtp=smtp.qq.com

Set [email protected]

Set Smtp-auth-password=xxxxx

Set Smtp-auth=login

    • Mail sending: Three ways to send the mail command

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8B/E9/ Wkiom1hb3-hgzsltaaafhwkcvlm599.png "" 1347 "height="/>

1, using the shell directly when the editor 2, using the pipeline to send mail 3, the use of files for mail delivery

Three ways each have pros and cons, but the way the message content is different, the essence is the same. Excerpt the works of netizens, such as:

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/8B/E9/wKiom1hb3-KDN1_ Vaabgxzvpcj0560.png "" 710 "height=" 424 "/>

I'm going to use a script, so I'm using pipelines.

Three, Scheduled tasks:

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" Http://s3.51cto.com/wyfs02/M02/8B/E9/wKiom1hb3-OA4tvoAAAs_ Pj8hnc984.png "" 631 "height=" 387 "/>

650) this.width=650; "title=" image "style=" border-top:0px; border-right:0px; Background-image:none; border-bottom:0px; padding-top:0px; padding-left:0px; border-left:0px; padding-right:0px "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/8B/E9/ Wkiom1hb3-twv-79aabo2z2xgks700.png "" 910 "height=" 387 "/>

Linux Automatically send mail

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.