代码之家  ›  专栏  ›  技术社区  ›  vector

cakePHP和邮件组件:拒绝连接:61

  •  1
  • vector  · 技术社区  · 17 年前

    问候语! 我正试图将简单的邮件功能添加到一个小web应用程序中,但我被卡住了。我可以在本地机器上从终端向自己发送电子邮件,但当我尝试运行应用程序时,我得到“连接被拒绝:61”

    $this->Email->smtpOptions = array(
       'port'=>'25',
       'timeout'=>'30',
       'host' => 'user-power-mac-g5.local',
       'username'=>'',
       'password'=>'',
       'client' => 'user@users-power-mac-g5.local'
    )
    
    $this->Email->delivery = 'smtp';
    
    $User = "some user"; 
    $this->Email->to = 'user@users-power-mac-g5.local';
    
    $this->Email->subject = 'Welcome';
    $this->Email->replyTo = 'user@users-power-mac-g5.local';
    $this->Email->from = 'Web App <user@users-power-mac-g5.local>';
    $this->Email->sendAs = 'text'; 
    $this->set('User', $User);
    $this->Email->send();
    $this->set('smtp-errors', $this->Email->smtpError);
    

    我试图在XAMPP上使用CakePHP1.2.5运行它,并且只运行核心邮件组件。 提前谢谢!

    1 回复  |  直到 17 年前
        1
  •  4
  •   jimiyash    17 年前

    许多ISP阻止端口25以防止垃圾邮件。您可能想尝试使用备用SMTP端口-587是最常见的。如果这不起作用,那么使用sendmail而不是SMTP可能会起作用。