Use Google SMTP to send emails in linux

Source: Internet
Author: User
Tags account gmail
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, you can send messages to the outside world... 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 in? There are Firefox Linux computers ,? ~ /. 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
Related 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.