title: Sending an email with an attachment to MULTIPLE people
body: <p>I am really new to sending emails in python. I can send individual emails with an attachment, multiple emails without one - but my code wont work for sending multiple emails AND the attachment. </p>
  
  <pre><code>    msg = MIMEMultipart()
      fromaddr = email_user
      toaddr = ["email"]
      cc = ["email2"]
      bcc = ["email3"]
  
      subject = "This is the subject"
      body = 'Message for the email' 
      msg = "From: %s\r\n" % fromaddr+ "To: %s\r\n" % toaddr + "CC: %s\r\n" % ",".join(cc) + "Subject: %s\r\n" % subject + "\r\n" + body
      toaddr = toaddr + cc + bcc
      msg.attach(MIMEText(body,'plain'))
      filename ="excelfile.xlsx" 
      attachment=open(filename,'rb')
      part = MIMEBase('application','octet-stream')
      part.set_payload((attachment).read())
      encoders.encode_base64(part)
      part.add_header('Content-Disposition',"attachment; filename= "+filename)
      msg.attach(part)
      text = msg.as_string()
      server = smtplib.SMTP('smtp.gmail.com',587)
      server.starttls()
      server.login(email_user,email_password)
      server.sendmail(fromaddr, toaddr, message) 
      server.quit()
  </code></pre>
  
  <p>I get the following error... AttributeError: 'str' object has no attribute 'attach'</p>