def mail_admins_contact(request, subject, message, context, sender):
 LOGGER.info(u'contact form from %s', sender)
 if (not settings.ADMINS):
  messages.error(request, _(u'Message could not be sent to administrator!'))
  LOGGER.error(u'ADMINS not configured, can not send message!')
  return
 mail = EmailMultiAlternatives((u'%s%s' % (settings.EMAIL_SUBJECT_PREFIX, (subject % context))), (message % context), to=[a[1] for a in settings.ADMINS], headers={u'Reply-To': sender})
 mail.send(fail_silently=False)
 messages.success(request, _(u'Message has been sent to administrator.'))

def mail_admins_contact ( request , subject , message , context , sender ) : LOGGER . info ( u'contact form from %s' , sender ) if ( not settings . ADMINS ) : messages . error ( request , _ ( u'Message could not be sent to administrator!' ) ) LOGGER . error ( u'ADMINS not configured, can not send message!' ) return mail = EmailMultiAlternatives ( ( u'%s%s' % ( settings . EMAIL_SUBJECT_PREFIX , ( subject % context ) ) ) , ( message % context ) , to = [ a [ 1 ] for a in settings . ADMINS ] , headers = { u'Reply-To' : sender } ) mail . send ( fail_silently = False ) messages . success ( request , _ ( u'Message has been sent to administrator.' ) )
sends a message to the admins .