Hey guys, with some testing I found, what imho might be a better way. You can't use if (!$smtp=Net::SMTP...) in the begining , it won;t accept it, but what does work is just letting the first one go, it won't crash the script if it fails. Then on the next line, test if $smtp is defined.
if it is defined then opening the server worked, if it is undefined, it failed and you can deal with it from there!!! thanx for your help all!