title: Python yagmail attachment not working
body: <p>I'm using <a href="https://github.com/kootenpv/yagmail" rel="nofollow">yagmail</a>-0.3.78 with Python 3.3 on Windows 8.1. I can get yagmail to send emails from my console but attachments just don't work.</p>
  
  <pre><code>yagmail.Connect('myemail@gmail.com','password').send('someguy@gmail.com', 'Test', 'This is a test', 'c:\\users\\lenovo\\appdata\\local\\temp\\mydoc.docx')
  </code></pre>
  
  <p>This returns an empty dict with no errors in the console. The email shows up with the right subject and body but no attachment. At first I thought my antivirus might be removing the attachment but there's nothing in the antivirus logs to suggest that it is.</p>
  
  <p>p.s. Apparently there is no tag for yagmail, and I don't have the rep to create it.</p>
  
  <p><strong>Edit-1:</strong> Some progress(?)</p>
  
  <pre><code>contents = ['This is a test', 'c:\\users\\lenovo\\appdata\\local\\temp\\mydoc.docx']
  yagmail.Connect('myemail@gmail.com','password').send('someguy@gmail.com', 'Test',contents)
  </code></pre>
  
  <p>...results in the below error.</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;string&gt;", line 301, in runcode
    File "&lt;interactive input&gt;", line 1, in &lt;module&gt;
    File "C:\Python33\lib\site-packages\yagmail-0.3.78-py3.3.egg\yagmail\yagmail.py", line 73, in send
      return self._attempt_send(addresses['recipients'], msg.as_string())
    File "C:\Python33\lib\site-packages\yagmail-0.3.78-py3.3.egg\yagmail\yagmail.py", line 79, in _attempt_send
      result = self.smtp.sendmail(self.user, recipients, msg_string)
    File "C:\Python33\lib\smtplib.py", line 749, in sendmail
      msg = _fix_eols(msg).encode('ascii')
  UnicodeEncodeError: 'ascii' codec can't encode characters in position 713-715: ordinal not in range(128)
  </code></pre>
  
  <p><strong>Edit-2:</strong> Thanks to PascalvKooten, see his answer below. Just a note on syntax...</p>
  
  <pre><code>yagmail.SMTP('mymail@gmail.com','password').send('someguy@gmail.com','Test1.2','This is a test','C:\\Users\\Lenovo\\AppData\\Local\\Temp\\mydoc.docx')
  </code></pre>
  
  <p>Does not work for me. However the below structure does work.</p>
  
  <pre><code>contents = ['This is a test', 'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\mydoc.docx']
  yagmail.SMTP('mymail@gmail.com','password').send('someguy@gmail.com','Test1.2',contents)
  </code></pre>