SwiftMailer->smtpType = 'tls'; $this->SwiftMailer->smtpHost = 'smtp.gmail.com'; $this->SwiftMailer->smtpPort = 465; $this->SwiftMailer->smtpUsername = 'my_username'; $this->SwiftMailer->smtpPassword = 'my_password'; $this->SwiftMailer->from = 'my_username@gmail.com'; $this->SwiftMailer->fromName = 'My Name'; $this->SwiftMailer->to = $this->data['Member']['email']; $this->set(array( 'username' => $this->data['User']['username'], 'password' => $this->data['User']['password'], )); if (!$this->SwiftMailer->send('register', 'Thanks for Registering!')) { $this->log('Error sending email "register".', LOG_ERROR); } ?>