[php] Swift_TransportException Connection could not be established with host smtp.gmail.com

remove from your config.yml spool: { type: memory }

Then you will be to add try catch like this

    try{
        $mailer = $this->getMailer();
        $response = $this->getMailer()->send($message);
    }catch(\Swift_TransportException $e){
        $response = $e->getMessage() ;
    }