Envio de e-mail após o registro no BD

Como faço para depois de salvar as informações enviar por e-mail as informações cadastradas?

não acontece nada. alguém pode me ajudar?

coloquei esse código no evento onafterInsert

$servidor_email = “smtp.gmail.com”;
$SMTP_Porta = “587”;
$usuario_email = “meuemail@gmail.com”;
$senha_Email = “123456”;
$from_email = “{e-mail}”;
$Email_para = “{e-mail}”;
$AssuntoEmail = “{assunto}”;
$ConteudoEmail = “{decricao}”;

if(filter_var($Email_para, FILTER_VALIDATE_EMAIL))
{
sc_mail_send($servidor_email, $usuario_email, $senha_Email, $from_email, $Email_para, $AssuntoEmail, $ConteudoEmail,“T” ,"" ,"" ,$SMTP_Porta, “S”,"","");
if ({sc_mail_ok})
{
sc_error_message(“Email Enviado!”);
}
else
{
sc_error_message(“Erro envio Email!”);
}
}

sc_mail_send($servidor_email, $usuario_email, $senha_Email, $from_email, $Email_para, $AssuntoEmail, $ConteudoEmail,“T” ,"" ,"" ,$SMTP_Porta, “S”,"","");

usa apenas isso e vê se vc recebe o e-mail… precisa debugar pra ver…

Obs: o gmail precisa permitir aplicativos menos seguros.

Fatal error: Uncaught Swift_TransportException: Expected response code 220 but got code “”, with message “” in C:\Program Files\NetMake\v9-php73\wwwroot\scriptcase\prod\third\swift\classes\Swift\Transport\AbstractSmtpTransport.php:383 Stack trace: #0 C:\Program Files\NetMake\v9-php73\wwwroot\scriptcase\prod\third\swift\classes\Swift\Transport\AbstractSmtpTransport.php(289): Swift_Transport_AbstractSmtpTransport->_assertResponseCode(’’, Array) #1 C:\Program Files\NetMake\v9-php73\wwwroot\scriptcase\prod\third\swift\classes\Swift\Transport\AbstractSmtpTransport.php(117): Swift_Transport_AbstractSmtpTransport->_readGreeting() #2 C:\Program Files\NetMake\v9-php73\wwwroot\scriptcase\prod\third\swift\classes\Swift\Mailer.php(79): Swift_Transport_AbstractSmtpTransport->start() #3 C:\Program Files\NetMake\v9-php73\wwwroot\scriptcase\app\suporte_portal_segurado\form_form\form_form_apl.php(4388): Swift_Mailer->send(Object(Swift_Message), Array) #4 C:\Program Files\NetMake\v9-php73\wwwroot\scriptcase\app\suporte_portal_segurado\form in C:\Program Files\NetMake\v9-php73\wwwroot\scriptcase\prod\third\swift\classes\Swift\Transport\AbstractSmtpTransport.php on line 383

testei assim tb
$servidor_email = “smtp.gmail.com”;
$SMTP_Porta = “587”;
$usuario_email = “sysmasti00@gmail.com”;
$senha_Email = “111111”;
$from_email = “{e-mail}”;
$Email_para = “cesar@gmail.com”;
$AssuntoEmail = “{assunto}”;
$ConteudoEmail = “{decricao}”;

sc_mail_send($servidor_email, $usuario_email, $senha_Email, $from_email, $Email_para, $AssuntoEmail, $ConteudoEmail,“T” ,"" ,"" ,$SMTP_Porta, “N”,"","");

tenta com a porta 465 e coloca a opção o tls como S