Centos6.x use the mail command to send an emailUse the mail command to send an email
Because you often need to back up website data, you have learned how to send emails through shell in linux. Here, we use CentOS as an example to use the mail
Test of the Mail command under the Linux system1. One of the simplest examples:Mail-s test [email protected]r.comThe result of this command is to send an empty letter titled Test to the back of the mailbox, if you have an MTA and the back of the
Address: http://blog.sina.com.cn/s/blog_6a1837e90100prpy.html
To use the most common mail function in Ubuntu, you must install mailutils. Run the following command to install sudo apt-Get install mailutils: sudo apt-Get install sharutils;
The
Use the mail command in CentOS to send emails
The mail program on the Linux server calls sendmail to send mails. The sendmail server provides the function of sending mails externally. By default, you cannot send emails to CentOS. you can install a
The installation of the CentOS notebook without mouse operation is not convenient, two notebooks are placed on the desktop operation is also very inconvenient, so windows with SSH Landing server operation is very necessary. Download a putty, the
Linux Mail Command parameters:When you use mail to send mail, you must first start the SendMail service.Mail–s "Mail Subject" –c "CC Address" –b "BCC address"---F sender e-mail address –F sender name Three commonly used formats for sending
When you use the mail command in Ubuntu to send an email to back up data, You need to log on to the server every day to check whether the backup is successful. So I learned how to use shell to send emails to my mailbox in linux. Here we use ubuntu
In linux, the mail command can be used to send emails like in php, but the mail function requires simple configuration to send emails. Let's take a look at it.
Mail configuration
Configure the new version of mailx to send emails using an external
Linux Mail Command parameters:When you use mail to send mail, you must first start the SendMail service.Mail–s "Mail Subject" –c "CC Address" –b "BCC address"---F sender e-mail address –F sender name Three commonly used formats for sending
When you use mail to send mail, you must first start the SendMail service.mail–sMessage subject –c CC address –b---F sender e-mail address –F sender name Three commonly used formats for sending lettersMail-s test [email protected] #第一种方法, you can
In RHEL6, use the mail command to send external mail. First, uninstall the sendmail and postfix: yumremovesendmailyumremovepostfix that come with the system, and then in/etc/mail. add the following lines in rc: setfrom = 123456@126.comsetsmtp = smtp.
Recently the company hand-tour of a test area service end old hanging, so the whole script monitoring, hang up to send mail and then automatically restart the service.StartFirst mail A look, the results prompt command not found (company system are
One, the Mail command
1. Configuration
Vim/etc/mail.rc
Add the following to the end of the fileSet from=
[email protected]smtp= "Smtp.qq.com"
Set smtp-auth-user= "
[email protected]"Smtp-auth-password="
123456 "
Set Smtp-auth=login
Mail command cannot send mail-Linux Enterprise Application-Linux server application information. The following is a detailed description. Cohoohoxiong
Occasionally, I find that the mail command on my machine cannot be sent, and I read the error
Use the mail command in CentOS to send emailsConcepts
Email user proxy (MUA, Mail User Agent)Email sending proxy (MTA, Mail Transport Agent)Mail Distribution agent (MDA, Mail Deliver Agent)Mail commands andThe mailx command is used to view, write,
Mail command, linuxmail command
Mail -- View and send emails
Command path:/bin/mail
Example 1:
# Mail xiaohua
Run the command to send an email to xiaohua. After the email is written, Ctrl + D.
After logging on to the xiaohua user, enter
Mail Configuration
Configure new MAILX to use external mailboxes to send mail:
Edit/etc/nail.rc (Note that is not an older version of/etc/mail.rc): vi/etc/nail.rcAdd two lines:Set from=myname@qq.com smtp=smtp.qq.comSet Smtp-auth-user=myname
My BT version is backtrack5 R3. use the MAIL command to send an email to the QQ mailbox.
The original installation of mailutils does not display errors, but the QQ mailbox cannot receive emails. At this time, the MAIL command does not contain the-V
1. View Mail help information[Root @ local ~] # Mail-HMail: Invalid option -- HUsage: Mail [-iinv] [-s subject] [-c cc-ADDR] [-B bcc-ADDR] To-ADDR...[-- Sendmail-options...]Mail [-iinnv]-f [name]Mail [-iinnv] [-u user]
2. Use the MAIL command to
1. ConfigurationVim/etc/mail.rcAdd the following to the end of the fileSet from=[email protected]smtp= "Smtp.qq.com"Set smtp-auth-user= "[email protected]"Smtp-auth-password="123456 "Set Smtp-auth=loginDescription:From: The sender that appears when
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.