1

问候!我正在尝试将简单的邮件功能添加到一个小型网络应用程序中,但我被卡住了。我可以在本地机器上从终端向自己发送电子邮件,但是当我尝试运行应用程序时,我得到“连接被拒绝: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);

我正在尝试在带有 cakePHP 1.2.5 且只有核心邮件组件的 XAMPP 上运行它。提前致谢!

4

1 回答 1

4

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

于 2009-09-29T14:15:28.890 回答