NameError: name 'chunk' is not defined
chunks = [distro[x:x+10] for x in range(0, len(distro), 10)] outlook = client.Dispatch('Outlook.Application') for chunks in chunks: for name, address in chunk: message = outlook.CreateItem(0) message.To = address message.Subject = "Asortie Furniture and Decoration" message.HTMLBody = template.format(name) message.Send() Sleep(120)
Traceback (most recent call last):
File "<pyshell#17>", line 2, in
I'm an absolute noob when it comes to python, so i've been stuck trying to figure out how to fix the above error. I can save the emails in the drafts box, but whenever I want to distribute via chunking, I get this error. am I doing anything wrong?