0

I apologise for the rambling nature of this question, please bear with me and I'll provide all the extra info needed for you to stop me going mad from failing at something that looks inherently very straightforward...

I've just installed CakePHP 2.2, and the first thing I've done is add the cakeDC Users plugin. It's all working, apart from sending an email verification when a user registers.

I've tried so many combinations of different things in email.php, that I have now utterly got my knickers in a twist. Whatever I do, when the verification email should be sent, all I get is: No connection could be made because the target machine actively refused it.

My email.php currently looks like this:

class EmailConfig {

public $default = array(
    'transport' => 'Smtp',
    'from' => 'blah@gmail.com',
    //'charset' => 'utf-8',
    //'headerCharset' => 'utf-8',
);

public $smtp = array(
    'transport' => 'Smtp',
    'from' => array('Blah <blah@gmail.com>' => 'Chimp'),
    'host' => 'ssl://smtp.gmail.com',
    'port' => 465,  
    'timeout' => 30,
    'username' => 'blah@gmail.com',
    'password' => 'secret',
    'client' => null,
    'log' => false,
    //'charset' => 'utf-8',
    //'headerCharset' => 'utf-8',
);

public $fast = array(
    'from' => 'blah@blah.net',
    'sender' => null,
    'to' => null,
    'cc' => null,
    'bcc' => null,
    'replyTo' => null,
    'readReceipt' => null,
    'returnPath' => null,
    'messageId' => true,
    'subject' => null,
    'message' => null,
    'headers' => null,
    'viewRender' => null,
    'template' => false,
    'layout' => false,
    'viewVars' => null,
    'attachments' => null,
    'emailFormat' => null,
    'transport' => 'Smtp',
    'host' => 'blah.net',
    'port' => 25,
    'timeout' => 30,
    'username' => 'user',
    'password' => 'secret',
    'client' => null,
    'log' => true,
    //'charset' => 'utf-8',
    //'headerCharset' => 'utf-8',
);

}

How do I get cakeDC Users plugin to just send a non-SMTP email? Or do I have to use, for example, my Gmail details? But, if I do have to go down the SMTP route, what is wrong with the above?

Other info: I'm using the latest version of XAMPP and my PHP install is ssl enabled.

JimBadger
  • 119
  • 2
  • 12
  • Oh, if I change the transport of $default back to Mail, the registration page runs through to completion, claiming to have sent an email (rather than erroring), but no email arrives. – JimBadger Oct 03 '12 at 21:50

1 Answers1

1

If you are on windows is reccomended that you use SMTP with your gmail details, yes. Do not forget to activate PHP's openSSL extension in order to be able to send mail via SSL.

Define your $email var like this:

App::uses('CakeEmail', 'Network/Email');

$email = new CakeEmail('smtp');

See if it works

Community
  • 1
  • 1
Herr Nentu'
  • 1,438
  • 3
  • 18
  • 49
  • Cheers. I've got that extension uncommented, but putting in my SMTP Gmail details gives the error indicated in my question. This is regardless of whether I try ssl, or tsl with the corresponding ports. – JimBadger Oct 04 '12 at 09:43