R. David Murray added the comment:
smtplib doesn't define any behavior for messages. I presume you are talking
about the email library?
Vis the print behavior, dict-style lookup is defined to return the first
matching header. If you want to see all of them, you can use get_all. For
debugg
Xavier Bonaventura added the comment:
I've seen that in the documentation is quite clear with it. The question would
be if the print should behave different, it is quite difficult to debug if not.
__setitem__(name, val)
Add a header to the message with field name name and value val. The field
New submission from Xavier Bonaventura :
The behavior when you assign an email to 'To' is counter intuitive.
When you do:
msg['To'] = 'f...@mail.com'
this appends the email instead of really assigning it.
This is because the assignment operator is overwritten.
Imagine that you have code like t