【问题标题】:Why use SMTP Authentication [duplicate]为什么使用 SMTP 身份验证 [重复]
【发布时间】:2013-12-12 20:12:36
【问题描述】:

为什么我应该使用像 PHPMailer 这样的邮件类而不是简单的 PHP mail 函数? 是否存在安全问题或垃圾邮件危险?

我不想使用PHPMailer的唯一原因是邮件密码显示在源代码中。使用简单的mail 函数可以避免这个问题。

谢谢

【问题讨论】:

    标签: php security email-spam


    【解决方案1】:
    PHPMailer is a PHP class for PHP (www.php.net) that provides a package of functions to send email. The two primary features are sending HTML Email and e-mails with attachments. PHPMailer supports nearly all possiblities to send email: mail(), Sendmail, qmail & direct to SMTP server. You can use any feature of SMTP-based e-mail, multiple recepients via to, CC, BCC, etc. In short: PHPMailer is an efficient way to send e-mail within PHP.
    
    As you may know, it is simply to send mails with the PHP mail() function. So why use PHPMailer? Isn't it slower? Yes that's true, but PHPMailer makes it easy to send e-mail, makes it possible to attach files, send HTML e-mail, etc. With PHPMailer you can even use your own SMTP server and avoid Sendmail routines used by the mail() function on Unix platforms. 
    
    Reference:
    http://code.google.com/a/apache-extras.org/p/phpmailer/wiki/UsefulTutorial
    

    【讨论】:

      【解决方案2】:

      使用 PHPMailer 可以更好地处理邮件头、html 邮件等。邮件功能是基本的方式。

      我建议你swiftmailer 的任何方式都有更好的支持,并且更现代一点。

      【讨论】:

        猜你喜欢
        • 2016-01-09
        • 1970-01-01
        • 2010-10-27
        • 2023-02-08
        • 2015-04-29
        • 1970-01-01
        • 1970-01-01
        • 2011-11-17
        • 2018-12-28
        相关资源
        最近更新 更多