This feature just works for cores that have 2fa command.
If your core support 2fa but don't have any command, you can check this: https://github.com/masterking32/WoWSimpleRegistration/pull/20 (Support some of the cores, Required to use 2fa for registration.)
$config['smtp_host']='smtp1.example.com';// Specify main and backup SMTP servers
$config['smtp_port']=587;// TCP port to connect to