def send_bulk_mail(sender_email, recipient_emails, subject, plaintext_body, html_body):
 if (not feconf.CAN_SEND_EMAILS):
  raise Exception('This app cannot send emails.')
 if (not mail.is_email_valid(sender_email)):
  raise ValueError(('Malformed sender email address: %s' % sender_email))
 for recipient_email in recipient_emails:
  if (not mail.is_email_valid(recipient_email)):
   raise ValueError(('Malformed recipient email address: %s' % recipient_email))
 for recipient_email in recipient_emails:
  mail.send_mail(sender_email, recipient_email, subject, plaintext_body, html=html_body)

def send_bulk_mail ( sender_email , recipient_emails , subject , plaintext_body , html_body ) : if ( not feconf . CAN_SEND_EMAILS ) : raise Exception ( 'This app cannot send emails.' ) if ( not mail . is_email_valid ( sender_email ) ) : raise ValueError ( ( 'Malformed sender email address: %s' % sender_email ) ) for recipient_email in recipient_emails : if ( not mail . is_email_valid ( recipient_email ) ) : raise ValueError ( ( 'Malformed recipient email address: %s' % recipient_email ) ) for recipient_email in recipient_emails : mail . send_mail ( sender_email , recipient_email , subject , plaintext_body , html = html_body )
sends an email using mailgun api .