Sendmail vs SMTP

后端 未结 4 408
花落未央
花落未央 2020-12-09 03:01

A rails application in production should use smtp or sendmail to send mails?

4条回答
  •  暖寄归人
    2020-12-09 03:28

    SMTP is the protocol that is used by nearly all Internet hosts to send mail. This protocol is spoken by sendmail. Sendmail determines where to send your message and how.

    Some mail programs (most, today) will connect directly to a mail server and speak SMTP to it. However, the "traditional" method - and arguable the better method - is to let sendmail do it.

    There are two reasons for this: 1) nearly every program in UNIX that does what sendmail does is designed to be a drop-in replacement (this includes Postfix and Exim for instance); and 2) sendmail or its replacement was designed to handle mail and nothing else - by using sendmail you don't have to design a SMTP client.

    The Mutt email client for UNIX is one email client that still refuses to talk SMTP directly to a mail server; a good (technical) description is on the wiki.

    If you have a choice (on UNIX anyway) of talking SMTP directly or using sendmail, use sendmail - especially on servers.

提交回复
热议问题