MimeWriter (how to use/find boundaries)

Grant Edwards ge at nowhere.none
Fri Jun 30 11:06:41 EDT 2000


In article <Pine.LNX.4.21.0006301138390.15363-100000 at lade.src.no>, Morten W. Petersen wrote:
>I've built a mail-sending function, which, when sending mail with
>attachments; does send the mail, with the encoded attachments; but it
>doesn't make the mail readable on the other side. I.e., it does not
>include the boundary thing, and I don't have a clue as to how to go about
>to do it. (...)

Take a look at 

 ftp://ftp.visi.com/users/grante/stuff/mfetch.py
 
There's a class in there called SmtpWriter (or something like
that) that builds e-mails with attachments using MimeWriter,
and then sends them using smtplib.

Look for the method named Message()

    def Message(self,sender="", subject="", recipients=[],body="", attachments=[]):
        if self.__debugLevel > 2:
            sys.stderr.write("SmtpWriter: Building RFC822 ....

-- 
Grant Edwards                   grante             Yow!  I would like to
                                  at               urinate in an OVULAR,
                               visi.com            porcelain pool --



More information about the Python-list mailing list