0

I'm able to get this plugin works after hours. But my problem now is that it didn't send the verification email.

this is my email.php config. I don't know how to set this up. So I just follow what others are doing.

class EmailConfig {

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

public $smtp = array(
    'transport' => 'Smtp',
    'from' => array('site@test.com' => 'My Site'),
    'host' => 'localhost',
    'port' => 25,
    'timeout' => 30,
    'username' => 'user',
    'password' => 'secret',
    'client' => null,
    'log' => false,
    //'charset' => 'utf-8',
    //'headerCharset' => 'utf-8',
);

public $fast = array(
    'from' => 'you@email.com',
    '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' => 'localhost',
    'port' => 25,
    'timeout' => 30,
    'username' => 'user',
    'password' => 'secret',
    'client' => null,
    'log' => true,
    //'charset' => 'utf-8',
    //'headerCharset' => 'utf-8',
);
}

Can anybody tell me how to make this thing right meaning that it send verification email?

Nizam
  • 505
  • 1
  • 8
  • 20

2 Answers2

1

Looks like you don't have an email server configured in your windows environment.

If you want to debug emails being sent you could use the Debug Transport this way

public $default = array(
    'transport' => 'Debug',
    'from' => 'you@email.com',
    'log' => 'email',
);

Then check email output written to file app/tmp/logs/email.log

steinkel
  • 1,156
  • 9
  • 15
0

It looks like your email.php config file is badly misconfigured.

Most likely CakeEmail is using $default, which you have setup as follows:

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

Basically you are setting transport to SMTP and you are missing all the necessary configuration to have it working.

So, you should set your transport to Mail as this:

public $default = array(
    'transport' => 'Mail',
    'from' => 'you@yourdomain.com',
);

CakeDC most likely is using default as the following:

$Email = new CakeEmail('default');

Then it should work....

AKKAweb
  • 3,795
  • 4
  • 33
  • 64
  • From CakeDC's GitHub page, it says that CakeDC Users uses `The plugin uses the $default email configuration (should be present in your Config/email.php file), but you can override it using`. So, as long as you change your Transport to Mail in the $default variable and your OS is correctly setup to send mails, you will have no issues... – AKKAweb Feb 07 '14 at 04:02
  • CakeDC suggests overriding if need be, but you dont have to in your case... `Configure::write('Users.emailConfig', 'default');` – AKKAweb Feb 07 '14 at 04:02
  • I already fix the default to Mail. But still not sending any verification email. – Nizam Feb 07 '14 at 04:14
  • Ok... are you able to test your system from command line using mail? Instructions can be found here, if needed: http://www.mydigitallife.info/how-to-send-an-email-mail-message-from-linux-command-line-shell/ – AKKAweb Feb 07 '14 at 04:29
  • im working on windows.. i guess i cannot use the mail command.. is there anything i need to tweak? – Nizam Feb 07 '14 at 04:51
  • I didnt know you were on Windows. Being on Windows makes it more difficult for me to give any opinion or suggestion as I dont know what it takes to fire an email in Windows/IIS. My suggestion, though, is that if I was you, I would get a VPS from Digital Ocean for a mere $5.00 to build and run these apps. Within a VPS you can do whatever you want and DigitalOcean makes it pretty affordable for anyone to own one. – AKKAweb Feb 09 '14 at 04:15