After some experimentation, it looks as though this might be your best bet assuming you don't want to use any extra modules:
MIME::Lite->send('smtp', $SmtpServer, Timeout=>60);
eval { $msg->send };
print $@ if $@; ### or do_something() if $@;
This will trap the errors and allow you to continue processing but it doesn't tell you if $SmtpServer is invalid. An invalid host would return a message something like this:
Failed to connect to mail server: Invalid argument
at mime.lite.p line ##
If the $SmtpServer doesn't allow relaying, you might get a message like this:
SMTP RCPT command failed:
What if the server times out? If you need to do more extensive error testing you might want to try using something like Net::SMTP, which is a subclass of Net::Cmd and IO::Socket::INET to send the message.
--Jim