Add default parameters and improve mail connection