Gmail smtp and cakephp 1.2 on xampp windows
Posted: Fri Apr 04, 2008 3:06 pm
I am running cakephp 1.2 on XAMPP on Windows XP. I am trying to test SwiftMailer integration with Cake using Gmail
Here is my code
However, the authenticate() method in SwiftMailer is return this:
Expected response code(s) [250] but got response [530 5.7.0 Must issue a STARTTLS command first. l22sm10679700waf.10]
Log Information
++ Log level changed to 3 << 220 mx.google.com ESMTP l22sm10679700waf.10>> EHLO [127.0.0.1] << 250-mx.google.com at your service, [75.43.217.110]250-SIZE 28311552 250-8BITMIME250-STARTTLS250 ENHANCEDSTATUSCODES>> AUTH CRAM-MD5 >> RSET << 530 5.7.0 Must issue a STARTTLS command first. l22sm10679700waf.10 !! Expected response code(s) [250] but got response [530 5.7.0 Must issue a STARTTLS command first. l22sm10679700waf.10]
How do I start STARTTLS? Is this an XAMPP, Cake, or SwiftMailer issue? I cannot seem to figure it out..
Thanks in advance
Here is my code
Code: Select all
$this->SwiftMailer->connection = 'smtp'; // default and thus you don't have to specify it
$this->SwiftMailer->smtp_host = 'smtp.gmail.com';
$this->SwiftMailer->smtp_type = 'tls';
$this->SwiftMailer->smtp_port = '587'; //'587'; //'465';
$this->SwiftMailer->username = 'xxx@gmail.com';
$this->SwiftMailer->password = 'xxx';
if($this->SwiftMailer->connect())
{
$this->SwiftMailer->addTo('from',"xxx@gmail.com","firstname lastname");
$this->SwiftMailer->addTo('to',"yyy@gmail.com");
$this->SwiftMailer->mailer->addPart("Plain Body");
$this->SwiftMailer->mailer->addPart("Html Body", 'text/html');
$this->SwiftMailer->send("Subject");
}
}However, the authenticate() method in SwiftMailer is return this:
Expected response code(s) [250] but got response [530 5.7.0 Must issue a STARTTLS command first. l22sm10679700waf.10]
Log Information
++ Log level changed to 3 << 220 mx.google.com ESMTP l22sm10679700waf.10>> EHLO [127.0.0.1] << 250-mx.google.com at your service, [75.43.217.110]250-SIZE 28311552 250-8BITMIME250-STARTTLS250 ENHANCEDSTATUSCODES>> AUTH CRAM-MD5 >> RSET << 530 5.7.0 Must issue a STARTTLS command first. l22sm10679700waf.10 !! Expected response code(s) [250] but got response [530 5.7.0 Must issue a STARTTLS command first. l22sm10679700waf.10]
How do I start STARTTLS? Is this an XAMPP, Cake, or SwiftMailer issue? I cannot seem to figure it out..
Thanks in advance