md5 password with phpMailer

前端 未结 2 2015
生来不讨喜
生来不讨喜 2021-01-16 07:22

I use the following code...

      $mail = new PHPMailer();  
      $mail->IsSMTP(); // send via SMTP
      $mail->SMTPAuth = true; // turn on SMTP auth         


        
2条回答
  •  盖世英雄少女心
    2021-01-16 07:32

    Unfortunately it isn't a question of support in phpMailer, but of your SMTP setup. In most cases your SMTP server won't know what to do with a password hash -- it needs the unhashed password so that it can check against its own password tables, which are unlikely to be stored in unsalted MD5 anyway.

    You can (if your SMTP server supports it) send the password through a secure connection (see PHPMailer: SMTP Error: Could not connect to SMTP host for a discussion about this). However, you'll still need to keep the password stored without encryption. One alternative to this, depending on your hosting package, is to set up SMTP such that it does not authenticate you by username and password -- for example, by using a properly configured local sendmail instance.

提交回复
热议问题