修改python原文件中的from、to字段
Here's an excerpt from the code I'm using. I'm looping through the part that adds the email; my problem is rather than changing the "to" field on each loop, it is appending the "to" data. Obviously this causes some issues, since the to field ends up getting longer and longer. I tried msgRoot.del_param('To') to no avail. I even tried setting the msgRoot['To'] to refer to the first index of a list so I could simply change the value of that list item (also didn't work).from email.MIMEMultipart import MIMEMultipart
msgRoot = MIMEMultipart('related')
msgRoot['To'] = 'email@email.com'
页:
[1]