Re: Sending mail through Gmail with CakeEmail (again)?

2012-10-26 Thread Vanja Dizdarević
I just found out that my timeout settings were the culprit for this error.

I upped my timeout property from 3000 to 30.000 and my test passes (the 
email has been sent). The "only" drawback is that the mail takes ages to go 
through (about 2 minutes on average.. :D). This makes this solution 
useless, unless I make my own queue of emails and run a cronjob on it...

So, I guess I should use my own server's smtp for sending notifications. 
Which is a question for another forum

Thanks guys, your answers are much appreciated.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Sending mail through Gmail with CakeEmail (again)?

2012-10-25 Thread kendosan
*check Google settings Account for ' allow* authentication' --> IMAP and 
POP3?  is active for the *SMTP* server in your mail client

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Sending mail through Gmail with CakeEmail (again)?

2012-10-25 Thread Chetan Varshney
I am using Gmail SMTP on local host and web server as well here is my code.

In email.php inside app/Config

public $gmail = array(
'transport' => 'Smtp',
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'timeout' => 3,
'username' => 'yourem...@gmail.com',
'password' => 'yourpassword',
'client' => null,
'log' => true
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
);


And in any controller for sending emails-

$fromConfig = 'Sender Email';
$fromNameConfig = 'Sender Email';
$emailObj = new CakeEmail();
$emailObj->from(array( $fromConfig => $fromNameConfig));
$emailObj->sender(array( $fromConfig => $fromNameConfig));
$emailObj->subject('Mail Subject');
$body='Mail Body';
// we are using gmail config for sending mails through Gmail Smtp
$emailObj->config('gmail');
$result = $emailObj->send($body);


On Wed, Oct 24, 2012 at 11:12 AM, Vanja Dizdarević <
lex.non.scri...@gmail.com> wrote:

> Sorry for not bumping old topics, but has anyone managed to send an email
> with CakeEmail and stmp.gmail.com?
>
> My settings:
> class EmailConfig {
> public $gmail = array(
>  'transport' => 'Smtp',
> 'from' => array('u...@domain.com' => 'Name'),
>  'host' => 'ssl://smtp.gmail.com',
> 'port' => 465,
>  'timeout' => 10,
> 'username' => 'u...@domain.com',
>  'password' => 'youwishyouknew',
> 'client' => null,
> 'log' => true,
>  //'charset' => 'utf-8',
> //'headerCharset' => 'utf-8',
> 'emailFormat' => 'html'
>  );
>
> My Controller code:
> function test_email(){
> $mail = new CakeEmail('gmail');
> $mail->addTo('u...@anotherdomain.com', 'User');
> $mail->from('u...@domain.com', 'User');
> $mail->subject('TESTING '.rand(10, 100));
> $mail->template('test', 'default');
> $return = $mail->send();
> debug($return);
> debug($mail);
> die();
> }
> I keep getting Connection timeouts and Socket errors. Basically, the damn
> thing won't even connect, auth is never even touched. (neither dev, nor
> production machine..)
>
> I am using Google Apps on that domain (same domain as the production, not
> that it should matter...)
>
> I have checked for mod_openssl on the server.
> I have double checked the auth info.
> I am using Cake 2.2.1
>
> Is there something else I'm missing? Or should I just search for another
> email library?
>
> Thanks! Cheers!
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>



-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Sending mail through Gmail with CakeEmail (again)?

2012-10-23 Thread Vanja Dizdarević
Sorry for not bumping old topics, but has anyone managed to send an email 
with CakeEmail and stmp.gmail.com?

My settings:
class EmailConfig {
public $gmail = array(
'transport' => 'Smtp',
'from' => array('u...@domain.com' => 'Name'),
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'timeout' => 10,
'username' => 'u...@domain.com',
'password' => 'youwishyouknew',
'client' => null,
'log' => true,
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
'emailFormat' => 'html'
);

My Controller code:
function test_email(){
$mail = new CakeEmail('gmail');
$mail->addTo('u...@anotherdomain.com', 'User');
$mail->from('u...@domain.com', 'User');
$mail->subject('TESTING '.rand(10, 100));
$mail->template('test', 'default');
$return = $mail->send();
debug($return);
debug($mail);
die();
}
I keep getting Connection timeouts and Socket errors. Basically, the damn 
thing won't even connect, auth is never even touched. (neither dev, nor 
production machine..)

I am using Google Apps on that domain (same domain as the production, not 
that it should matter...)

I have checked for mod_openssl on the server.
I have double checked the auth info.
I am using Cake 2.2.1

Is there something else I'm missing? Or should I just search for another 
email library?

Thanks! Cheers!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.