email modules and attachments that aren't there

Russell Bungay bigmaddrongo at
Tue Jan 10 05:02:01 EST 2006

Russell Bungay wrote:

>         for attachment in attachments:
> 	  <snip contents of for loop> 	 

>	sub_msg = email.Message.Message()
>       sub_msg.add_header('Content-type', content_type, name=attachment)
>      	sub_msg.add_header('Content-transfer-encoding', cte)
>       sub_msg.set_payload(contents_encoded.getvalue())
>      	main_msg.attach(sub_msg)

These lines should of course be within the for, not outside it.  Apologies.


More information about the Python-list mailing list