mc can be safely used in the anonymous inner class instance of Function0 that you have created. The null error for mc.getId() will only come if mc is null. If getId() returns null then null will be passed as value to the setParameter method. But if mc is null then you are actually trying to call a method getId on a null object which is not correct.
So if yo getting null in this code, check at the place from where you are calling sendMailToTheRegulator method. Most probably the mc parameter being passed in null.