using MIME::Lite now
changed order of checking