Send emails via external SMTP in LINUX (directly discard sendmail and postfix)

Source: Internet
Author: User
In LINUX, sending emails via external SMTP (directly abandoning sendmail and postfix). as for how troublesome the sentmail and postfix configurations are, the old man will not talk nonsense here... it takes N hours for the old man to complete the configuration... the following method can completely get rid of this...
In LINUX, sending emails via external SMTP (directly abandoning sendmail and postfix). as for how troublesome the sentmail and postfix configurations are, the old man will not talk nonsense here... it takes N hours for the old man to complete the configuration...
The following methods can free you from these two tools... of course, if you want to create an email server, you should be a different one...
If you only want the server to automatically send an email or something, you can use the following method to disable the sendmail service or postfix service on the local machine. # execute the following command, all heroes should check their seats # sendmialservice sendmail stopchkconfig sendmail off # postfixservice postfix stopchkconfig postfix off # uninstall them if you want to find it again .. yum remove sendmailyum remove postfix www.2cto.com and then modify/etc/mail. rc: add N lines to specify the external smtp server address and account password. 1 # vi/etc/mail. rc 2 set from = 123456@qq.com3 set smtp = smtp.qq.com 4 set smtp-auth-user = 1234565 set smtp-auth-password = sbsbsbsb6 set smtp-auth = login and then send mail echo through command hello word | mail-s "title" 123456@qq.com, but found that running in RHEL6 is no problem, in RHEL5, the mail command always calls the local sendmail service to send emails. What is the relationship between mail and mailx in RHEL6 and RHEL5? Mail under www.2cto.com RHEL6 link to mailx command, mailx version is 12.4 # rpm-qa | grep mailx mailx-12.4-6.el6.x86_64 # ll/bin/mail * www.2cto.com lrwxrwxrwx. 1 root 5 October 2011/bin/mail-> mailx-rwxr-xr-x. 1 root 390424 February 16 2010/bin/mailx # mail-V 12.4 7/29/08
In RHEL5, we found some different mailx links to mail commands, mailx version 8.1 # rpm-qa | grep mailx mailx-8.1.1-44.2.2 # ll/bin/mail *-rwxr-xr-x 1 root mail 84856 Jun 6 2007/bin/mail lrwxrwxrwx 1 root 4 Apr 12/bin/mailx-> mail # mail-V this operation will cause an error, no-V parameter
That is to say, in RHEL6 \ 5, running mail and mailx is actually a command, but different mail versions make the mail command under RHEL5 unable to call the external SMTP server. Installing the new version of mailx solves this problem. : Activate this website. Choose one of your own # tar jxvf mailx-12.4.tar.bz2 # cd mailx-12.4 # make install UCBINSTALL =/usr/bin/install view mailx program default installation location, and version # whereis mailx www.2cto.com mailx: /usr/local/bin/mailx/usr/share/man/man1p/mailx.1p.gz # mailx-V 12.4 7/29/08
The installed mailx uses the/etc/nail. rc configuration, not/etc/mail. rc. Edit vi, Press G, and add the following N lines at the end of the line # vi/etc/nail. rc (do you see the highlights ?) 2 set from = 123456@qq.com 3 set smtp = smtp.qq.com 4 set smtp-auth-user = 123456 5 set smtp-auth-password = sbsbsbsb 6 set smtp-auth = login and then send email echo hello word | mailx-v-s "title" 123456@qq.com will receive the email .... brother is too lazy to give it to you... I have received it. If the message is sent successfully, you will see a message similar to 235 2.7.0 Authentication successful >>> mail from: 250 2.1.0 OK www.2cto.com >>> RCPT: 250 2.1.5 OK >>> DATA 354 End data . >>>. 250 2.0.0 OK: queued as 9291963494 >>> QUIT 221 2.0.0 Bye
 
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.