code: def send_mails(cls):
          
          if settings.CAS_NEW_VERSION_EMAIL_WARNING and settings.ADMINS:
              try:
                  obj = cls.objects.get()
              except cls.DoesNotExist:
                  obj = NewVersionWarning.objects.create(version=VERSION)
              LAST_VERSION = utils.last_version()
              if LAST_VERSION is not None and LAST_VERSION != obj.version:
                  if utils.decode_version(VERSION) < utils.decode_version(LAST_VERSION):
                      try:
                          send_mail(
                              (
                                  '%sA new version of django-cas-server is available'
                              ) % settings.EMAIL_SUBJECT_PREFIX,
                              u'''
  A new version of the django-cas-server is available.
  
  Your version: %s
  New version: %s
  
  Upgrade using:
      * pip install -U django-cas-server
      * fetching the last release on
        https://github.com/nitmir/django-cas-server/ or on
        https://pypi.org/project/django-cas-server/
  
  After upgrade, do not forget to run:
      * ./manage.py migrate
      * ./manage.py collectstatic
  and to reload your wsgi server (apache2, uwsgi, gunicord, etc…)
  
  --\u0020
  django-cas-server
  '''.strip() % (VERSION, LAST_VERSION),
                              settings.SERVER_EMAIL,
                              ["%s <%s>" % admin for admin in settings.ADMINS],
                              fail_silently=False,
                          )
                          obj.version = LAST_VERSION
                          obj.save()
                      except smtplib.SMTPException as error:  # pragma: no cover (should not happen)
                          logger.error("Unable to send new version mail: %s" % error)
docs: For each new django-cas-server version, if the current instance is not up to date
              send one mail to ``settings.ADMINS``.