Implementing shell bulk mail scripts in Linux

Source: Internet
Author: User
Tags auth

Linux version: CentOS 6.7//Can be viewed using lsb_release-a

First, modify the/etc/mail.rc//on the last side of the line, you can also echo >>

Set [email protected]//your own real e-mail address

Set smtp=smtp.exmail.qq.com//In mailbox settings, client settings, Setup method, send server

Set [email protected]//real address of your own email

Set smtp-auth-password=123456//own email password

Set Smtp-auth=login

: Wq

Two, to here has realized the implementation of external mailbox sent mail, you can command line input

echo "Test Mail" | Mail-s "Test" [email protected]

########################################################################

You can also write scripts:

#!/bin/bash

User= "

Target 1 123456789@qq. com

Target 2 [email protected]

......

"

Userlist= ' Echo-e "${user}" | awk ' {print $} '

Echo $userlist

Mail-v-S "Test Mail" $userlist < Test.txt

: Wq

which

-V Show More information

-S Message header

Test.txt is the content you want to enter the message

Then CRONTAB-E edit the scheduled task, you can implement the scheduled email!


This article is from the Linux OPS blog, so be sure to keep this source http://dywwen.blog.51cto.com/12715220/1916019

Implementing shell bulk mail scripts in Linux

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.