Question

Greetings! I'm trying to add simple mail functionality to a little web app and I'm stuck. I'm able to send email from the terminal to myself on local machine just fine, but when I try to run the app I get "Connection refused: 61"

At first I thought my setting are messed up, I kept playing with them for a while and for now decided to give up at this point:

$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);

I'm trying to run this on an XAMPP with cakePHP 1.2.5 and only the core mail comp. Thanks in advance!

Was it helpful?

Solution

Many ISPs block port 25 to prevent spam. You might want to try using the alternate SMTP port - 587 is the most common. If that doesn't work, then maybe using sendmail instead of SMTP might work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top