Minister resigns for sending 'sex message'