@task(bind=True)
def send_activation_email(self, subject, message, from_address, dest_addr):
 max_retries = settings.RETRY_ACTIVATION_EMAIL_MAX_ATTEMPTS
 retries = self.request.retries
 try:
  mail.send_mail(subject, message, from_address, [dest_addr], fail_silently=False)
  log.info('Activation Email has been sent to User {user_email}'.format(user_email=dest_addr))
 except NoAuthHandlerFound:
  log.info('Retrying sending email to user {dest_addr}, attempt # {attempt} of {max_attempts}'.format(dest_addr=dest_addr, attempt=retries, max_attempts=max_retries))
  try:
   self.retry(countdown=settings.RETRY_ACTIVATION_EMAIL_TIMEOUT, max_retries=max_retries)
  except MaxRetriesExceededError:
   log.error('Unable to send activation email to user from "%s" to "%s"', from_address, dest_addr, exc_info=True)
 except Exception:
  log.exception('Unable to send activation email to user from "%s" to "%s"', from_address, dest_addr, exc_info=True)
  raise Exception

@ task ( bind = True ) def send_activation_email ( self , subject , message , from_address , dest_addr ) : max_retries = settings . RETRY_ACTIVATION_EMAIL_MAX_ATTEMPTS retries = self . request . retries try : mail . send_mail ( subject , message , from_address , [ dest_addr ] , fail_silently = False ) log . info ( 'Activation Email has been sent to User {user_email}' . format ( user_email = dest_addr ) ) except NoAuthHandlerFound : log . info ( 'Retrying sending email to user {dest_addr}, attempt # {attempt} of {max_attempts}' . format ( dest_addr = dest_addr , attempt = retries , max_attempts = max_retries ) ) try : self . retry ( countdown = settings . RETRY_ACTIVATION_EMAIL_TIMEOUT , max_retries = max_retries ) except MaxRetriesExceededError : log . error ( 'Unable to send activation email to user from "%s" to "%s"' , from_address , dest_addr , exc_info = True ) except Exception : log . exception ( 'Unable to send activation email to user from "%s" to "%s"' , from_address , dest_addr , exc_info = True ) raise Exception
sending an activation email to the users .