I'm guessing you use the mailer service to send the emails? If not, you have to.
this->get('mailer')->send($messaggio);
To send the emails not immediately you can configure a spool. Two spools are supported. The memory spool, which holds the messages in memory and sends them after the kernel has terminated, which means everything got rendered and sent to the client. Or the file spool. With it, the messages got saved into a file, and you have to issue a console command from a cronjob periodically to send the mails.