Probably this is because the change in SMTP settings is not reflected in kunena configuration.
May be we should update the from email in kunena config too, for now you can go in the backend and update or update in the #__kunena_config table.
A better way would be to write the code in globalconfig.php adminsettings plugin