Test that mail func is being called