<br><br><div class="gmail_quote">On Fri, Jul 8, 2011 at 3:23 PM, Steffen Frömer <span dir="ltr">&lt;<a href="mailto:steffen.froemer@gns-systems.de">steffen.froemer@gns-systems.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><div class="im">
    On 07/08/2011 10:16 PM, Tim Roberts wrote:
    <blockquote type="cite">
      <pre>Steffen Frömer wrote:
</pre>
      <blockquote type="cite">
        <pre>i tried to access standard mail application to write a mail.
I know the machanism with urllib, but there is no regular way to add
attachments.
</pre>
      </blockquote>
      <pre>How would you do that with urllib?</pre>
    </blockquote></div>
    <div class="im"><br>
    <blockquote type="cite">
      <pre>However, to be completely general, you need to use smtplib to send to an
external mail server.</pre>
    </blockquote></div>
    This is no option, because there is noch smtp-server withouf
    authentication and we need to send mails from different users.<br>
    <blockquote type="cite">
      <pre></pre>
    </blockquote>
    Regards,<br>
    Steffen<br>
  </div>

<br></blockquote><div>Steffen:<br>  You (who ever you mean when you say &quot;we&quot;) should probably set up a dedicated smtp-server for your group.  If many of your users have OUTLOOK, then you may have an exchange server which could be used for that purpose.  In my own case, it was fairly easy to get that administrator to turn on smtp support on the company&#39;s exchange server.  I wrote a little private in-company-email module which was pre-programmed with the name of the exchange server and with our company&#39;s authentication. The smtplib calls were embedded within it. <br>

  To add an attachment, you need MIME -- which was invented for that exact purpose.  There is a whole library of python standard modules for doing that.  See <a href="http://docs.python.org/library/email.html">http://docs.python.org/library/email.html</a> and an example in <a href="http://code.activestate.com/recipes/52243-sending-multipart-mime-email-with-smtplib-and-mime/">http://code.activestate.com/recipes/52243-sending-multipart-mime-email-</a><br>

<a href="http://code.activestate.com/recipes/52243-sending-multipart-mime-email-with-smtplib-and-mime/">with-smtplib-and-mime/</a>  <br>  That ought to be much easier than hacking OUTLOOK -- especially if you must support version updates, etc.<br>

--<br>Vernon<br></div></div><br>