Linux bash mailx send mail content to an attachment Tcmime.1278.1278.1724.bin or Att00001.bin

Source: Internet
Author: User

After installing the Zabbix, set the mail script alarm, the sent alarm content becomes tcmime.1278.1278.1724.bin or att00001.bin.

Yum-y Install MAILX Dos2unix//Installation MAILX tools and Dos2unix conversion tools

Here is the script content:

[email protected] alertscripts]# cat sendmail.sh

#!/bin/bash

#export LANG=ZH_CN. UTF-8 //solve the problem of sending the Chinese into garbled


File=/tmp/mailtmp.txt

echo "$ $" > $FILE

dos2unix-k $FILE //Resolves an issue where the content of the sent message becomes an attachment.

/bin/mail-s "$" $ < $FILE



---------------------------

In reference to the online treatment of many great gods, eventually formed the above script, solve the problem.

This article is from the "Mountain Road 18 Bend" blog, please be sure to keep this source http://kongzi68.blog.51cto.com/1432619/1637505

Linux bash mailx send mail content to an attachment Tcmime.1278.1278.1724.bin or Att00001.bin

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.