[Zope] how to send email witch attachment in python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christian Otteneuer

    #1

    [Zope] how to send email witch attachment in python

    Hello NG,

    How can I send an email with an attachment from a python script?
    My code so far:

    mailhost = container.mailH ost
    mMsg = 'MessageText'
    mTo = 'you@you.com'
    mFrom = 'me@me.com'
    mSubj = 'Subject'

    This code sends me an email with 'Subject' and 'MessageText' .
    After googling and reading in different tutorials, I found a way to
    implement it in dtml:

    <dtml-sendmail smtphost="MailH ost">
    To: you@you.com
    From: Me me@me.com
    Subject: <dtml-var "var1">
    <dtml-mime type="text/plain" encode="7bit">
    Hi, please take a look at my resume.
    <dtml-boundary type="applicati on/octet-stream" disposition="at tachment"
    encode="base64" filename_expr=" resume_file.get Id()"><dtml-var
    expr="resume_fi le">
    </dtml-mime>
    </dtml-sendmail>But how to do so in python only?Thanks alotChristian


  • Michele Simionato

    #2
    Re: [Zope] how to send email witch attachment in python

    "Christian Otteneuer" <chotty@freenet .de> wrote in message news:<ck6lr2$10 eo$1@news.uni-koblenz.de>...[color=blue]
    > Hello NG,
    >
    > How can I send an email with an attachment from a python script?[/color]

    If you want to send an email using Zope you are OT and you should ask
    a Zope list; OTOH if you want to send an email from Python, just
    use the email module and look at the documentation in the standard
    library (especially the examples; they show how to do what you ask).

    Michele Simionato

    Comment

    Working...