$this->SwiftMailer->connection = 'smtp'; $this->SwiftMailer->smtp_host = 'smtp.gmail.com'; $this->SwiftMailer->smtp_type = 'tls'; $this->SwiftMailer->username = 'user@gmail.com'; $this->SwiftMailer->password = 'secret'; if($this->SwiftMailer->connect()) { $this->SwiftMailer->addTo('to',"crazylegs@gmail.com","CraZyLeGs"); $this->SwiftMailer->addTo('from',"user@gmail.com","some user"); if(!$this->SwiftMailer->sendView("SwiftComponent::sendView Exemple","confirm",'both')) { echo "The mailer failed to Send. Errors:"; pr($this->SwiftMailer->errors()); } echo "Log:"; pr($this->SwiftMailer->transactions()); } else { echo "The mailer failed to connect. Errors:"; pr($this->SwiftMailer->errors()); }