CENTOS uses MUTT to send emails. centosmutt

Source: Internet
Author: User
Tags centos server

CENTOS uses MUTT to send emails. centosmutt

Sometimes we need to send emails on the Centos server, such as backing up the MySQL database and sending it to the specified mailbox. Here we will talk about how to send emails from the Centos shell command.

Check, install, and start sendmail
// Check ps-ef | grep sendmail // install yum install sendmail // start service sendmail start // start chkconfig -- level 2345 sendmail on
Check and install mutt
// Check whether mutt is installed. If mutt is installed,/usr/bin/mutt # which mutt will be returned. // install mutt # yum install mutt
Configure mutt
// Copy. muttrc # cp/etc/Muttrc/root/. muttrc for the root user
Configure mutt. The above two methods are modified in the same way.
# Set charset = "UTF-8" # customize the sender information set envelope_from = yes # This line does not exist by default, please manually add set use_from = yes set from = xxx.com@xx.comset realname = "Master Lee"
Test email sending
// Syntax mutt [-hnpRvxz] [-a <File>] [-B <address>] [-c <address>] [-f <email>] [- F <Configuration File>] [-H <email draft>] [-I <File>] [-m <type>] [-s <topic>] [email address]
Send
Mutt 1343652445@qq.com-s "test mutt"-a test.txt <test.txt echo "mail body" | mutt 1343652445@qq.com-s "xxxx"-a test.txt

 

If the email is sent incorrectly, view the log (/var/log/maillog)

 

This 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.