当前位置:网站首页>The mail command is used in combination with the pipeline command statement

The mail command is used in combination with the pipeline command statement

2022-07-06 20:31:00 sky9899

Operating environment :

OS: CentOS Linux release 7.9.2009 (Core)

Practical task : Send email interactively , At the same time, combined with pipeline command statements , Put the edited content with the title “ pack ”, Finally, a command is used to send the email .

      
      
[[email protected] ~] # yum install mailx
[[email protected] ~] # vi /etc/mail.rc
set bsdcompat
set from =***@163.com # Mailing address
set smtp =smtp.163.com # Send mail server
set smtp-auth-user =***@163.com # account number
set smtp-auth-password =****** # Application authorization code
set smtp-auth =login # Mail authentication method

[[email protected] ~] # yum install sendmail

[[email protected] ~] # systemctl start sendmail.service
# Use pipe sign sentences
[[email protected] ~] # echo "Content" | mail -S "Subject" ***@163.com
Non-null variable name required
Could not resolve host:
"/root/dead.letter" 10/277
. . . message not sent.
# The above error , The main reason is “=” There are spaces in the symbol
set smtp = smtp.163.com
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.

mail Mail commands are used in conjunction with pipeline command statements _sendmail

mail Mail commands are used in conjunction with pipeline command statements _ Send E-mail _02

mail Mail commands are used in conjunction with pipeline command statements _centos_03

Summary : Do the above experiments , There are two main steps : First, install and configure mailx、sendmail service ; secondly , To be in 163 Email application to open related services , At the same time, get the authorization code .

原网站

版权声明
本文为[sky9899]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131208532936.html