Enviar email do gatilho MySQL quando uma tabela for atualizada

Considere uma tabela comotable2eu gosto de adicionar umtrigger nesta mesaupdate Como

select Num into num from table1 where ID=new.id;
BEGIN
DECLARE done int default false;
DECLARE cur1 CURSOR FOR select EmailId from users where Num=num;
DECLARE continue handler for not found set done = true;
OPEN cur1;
my_loop: loop
    fetch cur1 into email_id;
    if done then
        leave my_loop;
    end if;
    //send mail to all email id.
end loop my_loop;
close cur1;
END;

Existe algum método simples para escrever no local comentado? Para enviar um email para todos os IDs de email recuperados da tabelausers.

Estou usando o MySQL no XAMPP (phpmyadmin).

questionAnswers(3)

yourAnswerToTheQuestion