Using Case with no column result
Application would be much better place to deal with such cases as Aaron Bertrand said but you can do it with SQL as well .

select
    case when TypeId = 1 then 1 
         when TypeId = 0 then 2
         end 
    from Type 
    where mail = 'name@test.com'
UNION ALL 
SELECT 3 
FROM DUAL 
 WHERE NOT EXISTS (SELECT NULL FROM Type WHERE mail = 'name@test.com')


**Depends on RDMS you're using you may or may not need specify "FROM DUAL".