input: Write a function to send an automated email to a list of recipients. The function should take a list of email addresses as input, iterate over the list, and send an email to each address using the Gmail SMTP server. If the email is sent successfully, print 'Email sent successfully.'.
  
  import smtplib
  
  def send_automated_email(recipient_emails):
      sender_email = 'example@gmail.com'
      password = 'example_password'
  
      for email in recipient_emails:
          with smtplib.SMTP('smtp.gmail.com', 587) as server:
              server.ehlo()
              server.starttls()
              server.login(sender_email, password)
  
              subject = 'Automated Email from Program'
              message = 'Message body'
      
              server.sendmail(sender_email, email, 'Subject: ' + subject + '\n\n' + message)
              server.quit()
              print('Email sent successfully.')
  
  recipient_emails = ["email1@example.com","email2@example.com"]
  send_automated_email(recipient_emails)
output: 
  import smtplib
  
  def send_automated_email(recipient_emails):
      sender_email = 'example@gmail.com'
      password = 'example_password'
  
      for email in recipient_emails:
          with smtplib.SMTP('smtp.gmail.com', 587) as server:
              server.ehlo()
              server.starttls()
              server.login(sender_email, password)
  
              subject = 'Automated Email from Program'
              message = 'Message body'
      
              server.sendmail(sender_email, email, 'Subject: ' + subject + '\n\n' + message)
              print('Email sent successfully.')
  