title: Send CSV files as single email attachment
body: <p>Have a script test.py which will generate 2 to 3 csv files making sql queries.
  CSV files will be generated and saved in the same path as  test.py.
  Generation of csv file is proper but the email attachment is not working
  Below is my code snippet :   </p>
  
  <pre><code>import smtplib
  import csv
  from email.mime.multipart import MIMEMultipart
  from email.message import Message
  from email.mime.text import MIMEText
  
  with open('record1.csv', 'wb') as f:
      fieldnames = ['Name','No audits']
      writer = csv.DictWriter(f, fieldnames=fieldnames)
      writer.writeheader()
      for data in query:
          writer.writerow({'Name' : data[0], 'No audits': data[1]})
  
  ## below code as problem 
  #Mail format
  COMMASPACE = ', '
  SERVER = "localhost"
  
  msg = MIMEMultipart()
  msg['Subject'] = 'Audit records'
  emailfrom = "xyz" // Giving proper outlook mail id 
  emailto = ['abc'] // // Giving proper outlook mail id lists
  
  msg['From'] = emailfrom
  msg['To'] = COMMASPACE.join(emailto)
  msg.preamble = 'List of  audit records '
  csvfiles = ['record1.csv', 'record2.csv']
  
  for csv in csvfiles:
          print csv
          with open(csv) as fp:
                  record = MIMEText(fp.read())
          msg.attach(record)
  
  print "INFO: "
  server = smtplib.SMTP(SERVER)
  server.sendmail(emailfrom, emailto, msg.as_string())
  server.quit()
  </code></pre>
  
  <p>script runs without errors but no email is sent</p>