original_docstring: Send the body string and any attachments to the list of
      recipients. The attachments_list is a list of tuples (real_name,
      attachment_name)
docstring: Send the body string and any attachments to the list of
  recipients.
docstring_tokens: Send the body string and any attachments to the list of recipients .
code: def _send_email(recipients_list,
                  sender,
                  subject,
                  body,
                  attachments_list = [],
                  cc_recipients_list = [],
                  verbose = 0):
     
      """Send the body string and any attachments to the list of
      recipients. The attachments_list is a list of tuples (real_name,
      attachment_name)"""
      
      if verbose>50:
         msgb('email 0.0')
      all_recipients = recipients_list + cc_recipients_list
      #recipients = ", ".join(all_recipients)
      recipients = ", ".join(recipients_list)
      cc_recipients = ", ".join(cc_recipients_list)
      # Create the enclosing (outer) message
      outer = MIMEMultipart()
      outer['Subject'] = subject
      outer['To'] = recipients
      outer['Cc'] = cc_recipients
      outer['From'] = sender
      if verbose:
         msgb("FROM", sender)
         msgb("TO", recipients)
         msgb("CC", cc_recipients)
      outer.preamble = 'You will not see this in a MIME-aware mail reader.\n'
      if verbose > 50:
         msgb('email 0.5')
      msg = MIMEText(body, _subtype='plain')
      msg.add_header('Content-Disposition', 'inline')
      outer.attach(msg)
      if verbose  > 50:
         msgb('email 1.0')
      for (real_name,attachment_name) in attachments_list:
         if verbose > 50:
            msgb('email 2.0', real_name + " " + attachment_name      )
         if not os.path.exists(real_name):
            die("Cannot read attachment named: " + real_name)
         fp = open(real_name,'r')
         msg = MIMEText(fp.read(), _subtype='plain')
         fp.close()
         if verbose > 50:
            msgb('3.0')
         msg.add_header('Content-Disposition', 'attachment',
                        filename=attachment_name)
         outer.attach(msg)
      if verbose > 50:
         msgb('4.0')
      # Now send or store the message
      composed = outer.as_string()
      s = smtplib.SMTP()
      if verbose > 50:
          s.set_debuglevel(1)
  
      # try connecting to a server from the list
      mail_server_list = check_smtp_host_env_var()
      connected = False
      for outgoing_mail_server in mail_server_list:
          try:
             msgb("MAIL SERVER", outgoing_mail_server)
             s.connect(outgoing_mail_server)
             connected = True
             break
          except:
             continue
  
      # last resort try the default
      if not connected:
          s.connect()
      rdict = s.sendmail(sender, all_recipients, composed)
      s.quit()
      if rdict and len(rdict) > 0:
         die("MAIL FAILED FOR " + str(rdict))
code_tokens: def _send_email ( recipients_list , sender , subject , body , attachments_list = [ ] , cc_recipients_list = [ ] , verbose = 0 ) : if verbose > 50 : msgb ( 'email 0.0' ) all_recipients = recipients_list + cc_recipients_list recipients = ", " . join ( recipients_list ) cc_recipients = ", " . join ( cc_recipients_list ) outer = MIMEMultipart ( ) outer [ 'Subject' ] = subject outer [ 'To' ] = recipients outer [ 'Cc' ] = cc_recipients outer [ 'From' ] = sender if verbose : msgb ( "FROM" , sender ) msgb ( "TO" , recipients ) msgb ( "CC" , cc_recipients ) outer . preamble = 'You will not see this in a MIME-aware mail reader.\n' if verbose > 50 : msgb ( 'email 0.5' ) msg = MIMEText ( body , _subtype = 'plain' ) msg . add_header ( 'Content-Disposition' , 'inline' ) outer . attach ( msg ) if verbose > 50 : msgb ( 'email 1.0' ) for ( real_name , attachment_name ) in attachments_list : if verbose > 50 : msgb ( 'email 2.0' , real_name + " " + attachment_name ) if not os . path . exists ( real_name ) : die ( "Cannot read attachment named: " + real_name ) fp = open ( real_name , 'r' ) msg = MIMEText ( fp . read ( ) , _subtype = 'plain' ) fp . close ( ) if verbose > 50 : msgb ( '3.0' ) msg . add_header ( 'Content-Disposition' , 'attachment' , filename = attachment_name ) outer . attach ( msg ) if verbose > 50 : msgb ( '4.0' ) composed = outer . as_string ( ) s = smtplib . SMTP ( ) if verbose > 50 : s . set_debuglevel ( 1 ) mail_server_list = check_smtp_host_env_var ( ) connected = False for outgoing_mail_server in mail_server_list : try : msgb ( "MAIL SERVER" , outgoing_mail_server ) s . connect ( outgoing_mail_server ) connected = True break except : continue if not connected : s . connect ( ) rdict = s . sendmail ( sender , all_recipients , composed ) s . quit ( ) if rdict and len ( rdict ) > 0 : die ( "MAIL FAILED FOR " + str ( rdict ) )
short_docstring: Send the body string and any attachments to the list of
  recipients.
short_docstring_tokens: Send the body string and any attachments to the list of recipients .
comment: """Send the body string and any attachments to the list of
      recipients. The attachments_list is a list of tuples (real_name,
      attachment_name)"""$SEP$#recipients = ", ".join(all_recipients)$SEP$# Create the enclosing (outer) message$SEP$# Now send or store the message$SEP$# try connecting to a server from the list$SEP$# last resort try the default