In linux, when Google SMTP is used to send mail to maintain the server, a server error warning system is often required, and mail is a good way. In linux, mail is generally used to write emails, and the sendmail service is used by default for delivery. In this way, though emails can be sent to the outside world, the emails cannot be replied, and the sendmail service requires the sender to be a user identifiable by the system, which is troublesome to configure. The following uses Google's SMTP server to send emails, which not only reduces the burden on the server, but also can use a similar public email address as the sender. All the steps below are based on CentOS 6.3, and other release versions are similar. 1. install mailyum install mailx-y 2. if you want to directly use sendmail to send emails, you need to start the sendmail service or saslauthd service 3. to use external SMTP to send emails, edit/etc/mail. rc, add the following content set from = demo@qq.com set smtp = smtp.qq.com set smtp-auth-user = demo set smtp-auth-password = demopass set smtp-auth = login, but this setting is only applicable to those supported non-ssl-linked SMTP server, if you want to use SSL encrypted connections like Google, configure mail 4 According to step 4. use Google's SMTP to send emails on Firefox's Linux computer ~ /. Copy cert *. db and key *. db of mozilla/firefox/xxxxxxxx. default/~ /. Mozilla_nss_shared_db edit/etc/mail. rc and add the following content: set ssl-verify = ignoreset nss-config-dir = ~ /. Export illa_nss_shared_dbset from = "myaccount@gmail.com (myname)" set smtp = smtps: // smtp.gmail.com: 465 set smtp-auth = loginset smtp-auth-user = myaccountset smtp-auth-password = mysecret if you want to add multiple accounts, then write the configuration file account starttls {set smtp-use-starttlsset ssl-verify = ignoreset nss-config-dir = ~ /. Export illa_nss_shared_dbset from = "myaccount@my.smtp.host (myname)" set smtp = smtp: // my. smtp. host: 25 set smtp-auth = loginset smtp-auth-user = myaccountset smtp-auth-password = mysecret} account gmail {set ssl-verify = ignoreset nss-config-dir = ~ /. Export illa_nss_shared_dbset from = "myaccount@gmail.com (myname)" set smtp = smtps: // smtp.gmail.com: 465 set smtp-auth = loginset smtp-auth-user = myaccountset smtp-auth-password = mysecret} when sending an email, you must use the-A parameter to specify the sending account, for example,-A gmail