2009-09-28 31 views
1

问候! 我想添加简单的邮件功能到一个小的web应用程序,我卡住了。我能够从本地机器发送电子邮件到我自己在本地机器就好了,但是当我尝试运行应用程序时,我得到“连接被拒绝:61”cakePHP和邮件组件:拒绝连接:61

起初我以为我的设置搞砸了,和他们一起玩了一会儿,现在决定在此时放弃:

$this->Email->smtpOptions = array(
    'port'=>'25', 
    'timeout'=>'30', 
    'host' => 'user-power-mac-g5.local', 
    'username'=>'', 
    'password'=>'', 
    'client' => '[email protected]' 
) 

$this->Email->delivery = 'smtp'; 

$User = "some user"; 
$this->Email->to = '[email protected]'; 

$this->Email->subject = 'Welcome'; 
$this->Email->replyTo = '[email protected]'; 
$this->Email->from = 'Web App <[email protected]>'; 
$this->Email->sendAs = 'text'; 
$this->set('User', $User); 
$this->Email->send(); 
$this->set('smtp-errors', $this->Email->smtpError); 

我试图使用CakePHP 1.2.5,只有核心邮件补偿上的XAMPP运行此。 在此先感谢!

回答

4

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

+0

谢谢!尝试了alt端口 - 没有喜悦,评论了SMTP的细节和交付 - 它至少在本地开发机器上像一个魅力。我们将看到在野外会发生什么:-) – vector 2009-09-29 16:29:02

+0

很高兴我可以帮助 – jimiyash 2009-09-30 04:02:45

+1

@jimiyash男人可爱,简单的答案...保存我的时间 – 2013-07-02 11:13:01

相关问题