title: Email Error help me with syntax error
body: <pre><code>import smtplib  
  from email import encoders
  from email.message import Message
  from email.mime.audio import MIMEAudio
  from email.mime.base import MIMEBase
  from email.mime.image import MIMEImage
  from email.mime.multipart import MIMEMultipart
  from email.mime.text import MIMEText
  msg = MIMEMultipart()
  msg.attach(MIMEText(file("P:/Email/test.txt").read()))
  
  
  
  sender = 'sender@email.com'  
  reciever  = 'reciever@email.com'  
  msg = 'Hello'  
  
  
  # Credentials (if needed)  
  username = 'user'  
  password = 'pass'  
  
  # The actual mail send  
  server = smtplib.SMTP('localhost')  
  server.starttls()  
  server.login(username,password)  
  server.sendmail(sender, reciever, msg)  
  server.quit()  
  </code></pre>
  
  <p>Traceback (most recent call last): File "attach2.py", line 27, in <br>
  server.sendmail(sender, reciever, msg) File "C:\Python33\lib\smtplib.py", line 775, in 
  sendmail (code, resp) = self.data(msg) File "C:\Python33\lib\smtplib.py", line 516, in
  data q = _quote_periods(msg) File "C:\Python33\lib\smtplib.py", line 167, in 
  quote_periods return re.sub(br'(?m)^.', b'..', bindata) File "C:\Python33\lib\re.py",
  line 170, in sub return _compile(pattern, flags).sub(repl, string, count) TypeError: 
  expected string or buffer</p>
  
  <p>why am i seeing this error message. is there something wrong with my python library file?</p>