Ascii encoding error during sending a mail
<p>I am new to python and trying to receive and resend an email using poplib and smtplib:</p>

<pre><code>    messages = [pop_conn.retr(i)[1] for i in range(1, mail_count + 1)]
    #decode messages
    messages = [[line.decode("utf-8") for line in message] for message in messages]
    # Concat messages
    messages = ["\n".join(msg) for msg in messages]
    #...        
    for message in messages:
        smtp_conn.sendmail(args.address, args.target, message)
</code></pre>

<p>In the debugger all message strings look good, but in the sendmail call following error occurs:</p>

<blockquote>
<pre><code>msg = _fix_eols(msg).encode('ascii')
</code></pre>
  
  <p>UnicodeEncodeError: 'ascii' codec can't encode character '\xa0' in position 17938: ordinal not in range(128)</p>
</blockquote>

<p>What am i doing wrong?</p>