Moving code form CiiController => EmailSettings for email sending