OK, this worked, please disregard my last. The online docs at
<a href="http://python.org">python.org</a> told me the answer to that one. Between their example and
yours, i am able to make it work.<br>
thanks a whole bunch !<br>
<br>
shawn<br><br><div><span class="gmail_quote">On 7/31/06, <b class="gmail_sendername">Justin Ezequiel</b> &lt;<a href="mailto:justin.mailinglists@gmail.com">justin.mailinglists@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
When I first started with Python, I used MimeWriter to create E-mails.<br><br>Then some mail servers rejected my E-mails.<br><br>Some research (google) indicated (to me) that I needed a MIME-Version header.<br>(Can't recall now if I also needed a Content-Type header.)
<br><br>Anyway, more research (Python docs) indicated that I should use the<br>email package instead.<br>I have been doing so since and have not had reports of anymore rejected E-mails.<br><br>Hope this helps.<br><br>&gt;&gt;&gt; import email
<br>&gt;&gt;&gt; from email.MIMENonMultipart import MIMENonMultipart<br>&gt;&gt;&gt; from email.Utils import formataddr<br>&gt;&gt;&gt; format_addresses = lambda pairs: ', '.join([formataddr(pair) for<br>pair in pairs])<br>
&gt;&gt;&gt; msg = MIMENonMultipart('text', 'plain', charset='us-ascii')<br>&gt;&gt;&gt; msg.set_payload('Foo Bar')<br>&gt;&gt;&gt; msg.add_header('From', formataddr(('Justin', '<a href="mailto:a@b.com">a@b.com</a>')))<br>
&gt;&gt;&gt; msg.add_header('To', format_addresses([('Justin', '<a href="mailto:a@b.com">a@b.com</a>'),<br>('You', '<a href="mailto:c@e.com">c@e.com</a>')]))<br>&gt;&gt;&gt; print msg.as_string()<br>Content-Type: text/plain; charset=&quot;us-ascii&quot;
<br>MIME-Version: 1.0<br>From: Justin &lt;<a href="mailto:a@b.com">a@b.com</a>&gt;<br>To: Justin &lt;<a href="mailto:a@b.com">a@b.com</a>&gt;, You &lt;<a href="mailto:c@e.com">c@e.com</a>&gt;<br><br>Foo Bar<br>&gt;&gt;&gt;
<br>_______________________________________________<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor
</a><br></blockquote></div><br>